App Service in Azure: A Ready-Made Home for Your Web Apps and APIs

App Service in Azure: A Ready-Made Home for Your Web Apps and APIs

An intermediate guide to Azure App Service. Learn how plans, workers, and apps fit together, how deployment slots, scaling, networking, identity, and monitoring work inside, and how to design web applications that are secure, fast, resilient, and affordable.

Imagine you want to open a restaurant. You could buy land, build the walls, install the kitchen, hire security, connect water and electricity, and repair everything yourself. Or you could rent a fully equipped restaurant space in a managed food court, where the building, the power, the cleaning, and the guards are looked after by the owner, and you simply bring your recipes and your cooks. Azure App Service is that food court for web applications. You bring your code, and Azure provides the servers, the operating system, the web server software, the security patches, the scaling machinery, and the certificates, so you can focus on what makes your application special.

1What Is Azure App Service?

Start with a plain definition, then add the details one layer at a time.

Azure App Service is a fully managed platform for hosting web applications, REST APIs, and the back ends of mobile apps. It is called a Platform as a Service, or PaaS. That means Microsoft manages the lower layers for you: the physical servers, the virtualization, the operating system, the runtime updates, and the web server. You manage the top layer: your application code, its settings, and its data.

You can write your application in many popular languages and frameworks, such as .NET, Java, Node.js, Python, and PHP, and App Service runs it for you. You can also bring your own packaged application as a container image. Once running, your app is reachable over the internet through a web address, and you can add your own domain name and a security certificate.

App Service sits in the middle of the Azure hosting spectrum. Virtual machines give you the most control and the most work. Serverless functions give you the least control and the least work, for small event-driven pieces of code. App Service balances the two: you get steady, always-ready hosting with simple scaling, without administering any servers.

Simple Analogy

A virtual machine is renting an empty plot of land and building everything yourself. App Service is renting a furnished shop in a managed mall, where the mall owner fixes the roof, the lights, and the locks. You decide what to sell and how to arrange the shelves.

PaaS
Azure manages servers and operating system
Many
Languages, frameworks, and containers supported
Built in
Scaling, slots, certificates, authentication, monitoring

2The Problem App Service Solves

A tool makes sense when you know the pain it removes.

Running a web application the traditional way involves a long list of chores that have nothing to do with the application itself. Someone has to set up servers, install the operating system, apply security patches every month, install the right runtime versions, configure the web server, manage certificates before they expire, handle load balancing, and plan for traffic spikes. If any of these chores is forgotten, the application suffers.

Problem 1

Server maintenance

Operating systems and runtimes need constant patching, and a missed patch becomes a security hole.

Problem 2

Scaling for traffic

Traffic rises and falls. Buying capacity for the peak wastes money, while buying for the average causes slowdowns at busy times.

Problem 3

Risky releases

Deploying straight to the live site can cause downtime, and a bad release is slow to undo.

Problem 4

Certificates and domains

Expired certificates and misconfigured domains cause embarrassing outages.

Problem 5

Sign-in and security

Every application needs authentication, secrets handling, and network protection, and building them from scratch is slow and error-prone.

Problem 6

Visibility

Without logs and metrics, finding why an application is slow or failing is guesswork.

App Service addresses each of these with built-in features: automatic patching of the platform, manual and automatic scaling, deployment slots with swap, managed certificates and custom domains, built-in authentication, managed identities, network integration, and deep monitoring.

“With App Service, you spend your time on the application, and let the platform worry about the plumbing.”

3Core Concepts: App, Plan, and Worker

Three words explain the heart of App Service. Learn them well.

The most important idea in App Service is the difference between the app and the plan. They are separate Azure resources, and they have different jobs. Beginners often mix them up, and this causes confusion about cost and scaling.

Concept 1

App Service app

Your actual web application or API, with its code, settings, domain names, and deployment history. It is the thing visitors talk to.

Concept 2

App Service plan

The set of computing resources that apps run on. The plan decides the region, the operating system, the size of the machines, how many machines, and the price tier. You pay for the plan, not for each app.

Concept 3

Worker

A virtual machine instance inside the plan that actually runs your apps. If your plan has three instances, you have three workers, and every app in the plan runs on each of them.

Concept 4

Pricing tier

The family of the plan, such as Free, Basic, Standard, Premium, or Isolated, which decides features and the size of the workers.

Concept 5

Instance count

How many workers the plan has right now. Scaling out changes this number.

Concept 6

Runtime stack

The language and version your app uses, such as a particular .NET, Java, Node.js, Python, or PHP version, or a container.

flowchart TD
  SUB["Azure Subscription"] --> RG["Resource Group"]
  RG --> PLAN["App Service Plan: region, OS, size, tier, instance count"]
  PLAN --> W1["Worker 1"]
  PLAN --> W2["Worker 2"]
  PLAN --> W3["Worker 3"]
  RG --> APP1["App A: web site"]
  RG --> APP2["App B: API"]
  RG --> APP3["App C: back office"]
  APP1 -.runs on.-> PLAN
  APP2 -.runs on.-> PLAN
  APP3 -.runs on.-> PLAN
        
FIG 1 — Several apps share one plan, and every app runs on every worker of that plan
Simple Analogy

The plan is the shopping mall building with a certain number of floors, and each floor is a worker. The apps are shops inside the mall. You pay the rent for the mall building, not per shop, and every shop is open on every floor. Adding more shops costs nothing extra until the building is full.

i
Cost Insight

Because several apps can share one plan, you can host many small applications cheaply, as long as the plan has enough capacity for all of them together. This is one of the main cost advantages of App Service.

4Inside the Platform: How App Service Works Internally

A peek behind the curtain helps you reason about performance and problems.

App Service is built from several cooperating parts. Understanding them explains behavior that otherwise seems mysterious, such as why apps restart, why the first request after idle is slow, and how traffic reaches your code.

Part 1

Front ends

Shared machines that receive all incoming web requests, handle secure connections, and apply routing rules. They act as load balancers that pick a worker for each request.

Part 2

Workers

The virtual machines of your plan, where your application code actually runs inside an isolated sandbox.

Part 3

Shared content storage

A shared file storage that holds your app’s files, so that every worker sees the same content. On Windows, this includes the web root. On Linux, the application files are mounted in a similar way.

Part 4

Management and publishing services

Services that receive deployments, apply settings, and control the app’s lifecycle, including the Kudu management site.

Part 5

Sandbox

An isolation boundary around each app, so apps sharing a worker cannot see or disturb each other, and limits protect the machine.

1

A visitor requests your site

The browser looks up your domain name and connects to App Service’s public address.

2

A front end receives the request

It ends the secure connection, checks the host name, applies access restrictions, and finds which app this request belongs to.

3

The front end picks a worker

It chooses one of the workers in the plan, using load balancing and, if enabled, session affinity to prefer the same worker for the same visitor.

4

The worker runs your code

Your application inside its sandbox handles the request, perhaps calling databases or other services.

5

The response travels back

The answer goes through the front end to the visitor, and logs and metrics are recorded along the way.

sequenceDiagram
  participant V as Visitor Browser
  participant FE as App Service Front End
  participant W as Worker running your app
  participant DB as Database or other service
  V->>FE: HTTPS request to www.example.com
  FE->>FE: Check host name, access rules, authentication
  FE->>W: Forward to a chosen worker
  W->>DB: Query data if needed
  DB-->>W: Data
  W-->>FE: Response
  FE-->>V: HTTPS response
        
FIG 2 — The path of one request through App Service
Simple Analogy

The front end is the reception desk of the mall, checking who may enter and pointing each visitor to the right shop. The worker is the shop floor where staff actually serve customers. The shared storage is the common stockroom that every shop floor can reach.

5Operating Systems and Runtime Stacks

You must choose what your app runs on, and this choice is fixed per plan.

An App Service plan runs either Windows or Linux, and all apps in the plan share that operating system. You cannot mix Windows and Linux apps in one plan, although you can have separate plans in the same resource group. Choose according to your technology and your team’s habits.

PointWindows planLinux plan
Typical technologies.NET Framework, .NET, Node.js, Java, PHP.NET, Node.js, Python, Java, PHP, Ruby, and custom containers
Classic .NET Framework appsSupportedNot supported
ContainersWindows containers are supported on certain tiersLinux containers are widely supported
Management siteKudu with a Windows consoleKudu with a Linux console
Typical priceUsually higher because of license costsUsually lower
Best forExisting Windows-based applicationsOpen source stacks and new cloud-native apps
Option

Built-in runtime stacks

Microsoft maintains runtime images for popular languages. Updates to patch versions are applied by the platform, and you choose the major version.

Option

Custom containers

You package your application and its dependencies into a container image, store it in a registry, and App Service pulls and runs it. This gives you full control of the runtime environment.

Option

Code versus container

Code deployment is simpler to start. Containers give consistency between development and production and allow unusual dependencies.

!
Lifecycle Warning

Every language version has an end-of-support date. When a version goes out of support, App Service eventually stops offering it, and an app that stays on it loses security patches. Track the support dates of your runtime and plan upgrades ahead of time.

Simple Analogy

Choosing an operating system for the plan is like choosing the type of mall: one built for a certain style of shops, another for different styles. A container is like bringing your own pre-built shop on a truck and placing it inside the mall, with everything already arranged as you like.

6Pricing Tiers: Choosing the Right Size

The tier decides features, performance, scaling limits, and price.

App Service plans come in tiers. Lower tiers are meant for learning and light use, while higher tiers add scaling, slots, networking, and performance features. The names and details of tiers, sizes, and features evolve over time, and new generations appear, so use the following as a general map and confirm the current options in the documentation.

Tier familyTypical purposeNotable characteristics
Free and SharedLearning and tiny experimentsShared infrastructure with strict daily limits, no custom scaling, and limited features
BasicDevelopment, testing, and small low-traffic sitesDedicated machines, manual scaling to a few instances, no deployment slots
StandardProduction apps with moderate needsAutoscale, deployment slots, backups, and traffic routing
PremiumProduction apps needing more power and featuresMore and faster instances, more slots, richer networking and zone redundancy options
IsolatedStrict isolation and compliance needsRuns in a dedicated environment inside your own virtual network, with the highest scale limits
Factor

Machine size

Each worker has a certain number of processor cores and amount of memory. Bigger sizes cost more per instance.

Factor

Instance count

The total price is roughly the price per instance times the number of instances, while the plan exists.

Factor

Operating system

Windows plans usually cost more than Linux plans of the same size.

Factor

Commitments

Reservations or savings plans can lower the price of steady plans in some tiers, and Hybrid Benefit may apply for certain licenses.

i
Practical Advice

Start with the smallest tier that has the features you truly need, such as slots and autoscale for production, and measure real usage. Move up only when data shows a need. Always check current pricing with the Azure pricing calculator, because tiers and prices change.

Simple Analogy

Tiers are like hotel room classes. A budget room has a bed and a shower. A business room adds a desk and faster internet. A suite adds a separate living area. You pick the class according to what you need during your stay, not simply the biggest one available.

7Deploying Your App: Getting Code Into App Service

There are many ways in. Choose the one that fits your team and your process.

Continuous deployment from source control

Connect the app to a repository, for example on GitHub or Azure Repos. Whenever you push changes to a chosen branch, a pipeline builds and deploys them. This is the most common production approach, and it keeps a clear history of who deployed what.

Pipelines in GitHub Actions or Azure Pipelines

A workflow builds, tests, and deploys the app, and can deploy first to a staging slot, run checks, and then swap into production. It gives you full control over the process.

Zip deploy and package deploy

You upload a prebuilt package of your application. Run-from-package mode can mount the package as a read-only file system, which improves startup time and makes deployments more atomic.

Container deployment

You push an image to a registry, and App Service pulls it. Webhooks or pipelines can trigger a restart on a new image version.

Developer tools

Command-line tools, editor extensions, and the portal can publish directly. They are convenient for learning and quick tests, but production deployments should go through a repeatable pipeline.

FTP and manual methods

Older methods that copy files directly. They exist for compatibility, but they are easy to misuse and are best disabled or limited in production, in favor of secure, automated approaches.

1

Commit and push code

A developer pushes a change to the main branch after review.

2

The pipeline builds and tests

The code is compiled, unit tests run, and the package is created once.

3

Deploy to a staging slot

The package is deployed to a staging slot, where it can warm up and be tested without affecting visitors.

4

Verify and swap

Health checks and smoke tests confirm that staging works, and then the slot is swapped into production.

5

Monitor the release

Dashboards and alerts confirm the new version is healthy, and the swap can be reversed if not.

Simple Analogy

Deploying is like restocking a shop. You can carry boxes in through the front door during opening hours, which is messy and risky. Or you can prepare the new display in a back room and quickly swap it with the old one after closing the curtain for a moment.

8Deployment Slots: Safe Releases and Easy Rollback

Slots are one of the most valuable features for production apps.

A deployment slot is a live copy of your app with its own address, running in the same plan. A typical setup has a production slot, which serves real visitors, and a staging slot, where new versions are deployed and tested. Slots share the same plan resources, so they use the same workers, but they are separate apps with separate settings if you wish.

How a swap works

When you swap staging into production, App Service first applies the target slot’s settings to the staging instances and restarts them, then warms them up by sending requests, and once they respond correctly, it switches the routing so that production traffic goes to the new code. The old production code now lives in the staging slot, ready to be swapped back if a problem appears. Because the new version is already warm, visitors usually see no downtime and no cold start.

sequenceDiagram
  participant Dev as Pipeline
  participant Stg as Staging Slot
  participant Prod as Production Slot
  participant U as Visitors
  Dev->>Stg: Deploy new version
  Dev->>Stg: Run smoke tests
  Dev->>Stg: Start swap: apply production settings and warm up
  Stg->>Stg: Respond to warm-up requests
  Note over Stg,Prod: Routing switches
  U->>Prod: Requests now reach the new version
  Prod-->>U: Responses from new code
  Note over Stg: Old version waits in staging for instant rollback
        
FIG 3 — A slot swap warms up the new version and then switches routing
Feature

Sticky settings

Settings marked as slot-specific stay with the slot and do not move during a swap, such as a test database connection for staging. Other settings travel with the code.

Feature

Swap with preview

A two-phase swap that first applies production settings to the staging slot so you can test with real configuration, before completing the swap.

Feature

Auto swap

Automatically swaps a slot into production after a successful deployment to it, useful for simple pipelines.

Feature

Traffic routing

Send a chosen percentage of production traffic to another slot for gradual testing, similar to a canary release.

Feature

Custom warm-up

Define which paths to call during warm-up, so caches and connections are ready before real traffic arrives.

!
Common Mistake

Forgetting that slots share the plan’s resources. A busy staging slot, or a long load test against it, can slow down production because they run on the same workers. Also, a staging slot that is configured to use the production database can accidentally change real data during tests.

Simple Analogy

A slot swap is like a theatre with a hidden second stage. The crew builds and rehearses the next scene on the hidden stage, then rotates the stage so the audience instantly sees the finished set. If something looks wrong, they rotate back.

9Scaling: Up, Out, and Automatic

Handling more visitors means more power. There are two directions to grow.

Scale up (vertical scaling)

Change the plan to a larger size or higher tier, so each worker has more processor power and memory, or gains features. It requires a short transition, and every worker is bigger. It is useful when one request needs a lot of memory or processing, or when you need features of a higher tier.

Scale out (horizontal scaling)

Add more workers of the same size. Traffic is spread across them by the front ends. It is the usual way to handle more visitors, and it also improves resilience, because losing one worker leaves others running.

Autoscale

Rules that add or remove workers automatically based on metrics such as processor use, memory, or request counts, or based on a schedule. You set a minimum, a maximum, and a default instance count.

Automatic scaling (platform-managed)

On certain tiers, the platform itself can adjust the number of instances in response to HTTP load, with pre-warmed instances to avoid slowdown. It is simpler than writing rules, but available only for specific plans and options, so check current support.

flowchart LR
  M["Metric: CPU, memory, or requests"] --> R{"Rule check"}
  R -->|Above scale-out threshold| OUT["Add an instance"]
  R -->|Below scale-in threshold| IN["Remove an instance"]
  R -->|Between thresholds| KEEP["Keep the current count"]
  OUT --> CD["Cooldown period"]
  IN --> CD
  CD --> M
        
FIG 4 — Autoscale rules watch a metric, change the instance count, and then wait before the next decision
ApproachWhat changesBest forWatch out for
Scale upSize or tier of each workerMemory-hungry apps and needing higher tier featuresLimited by the largest size, and a single worker remains a single point of failure
Scale outNumber of workersMore concurrent visitors and resilienceThe app must work well with several instances running
AutoscaleInstance count, automaticallyVariable traffic and cost controlPoor rules can scale too slowly or oscillate

Designing apps that scale out

Rule

Keep the app stateless

Do not keep important user data in the memory or local disk of one worker. Store sessions and data in shared services such as a cache or database.

Rule

Use shared caching

A shared cache lets every worker see the same data, instead of each keeping its own version.

Rule

Make startup fast

New instances should become ready quickly, so autoscale helps in time.

Rule

Watch downstream limits

More workers mean more database connections and calls. Make sure the database and other services can handle the extra load.

Simple Analogy

Scaling up is replacing your shop counter with a bigger, stronger one. Scaling out is opening more counters side by side. Autoscale is a manager who opens extra counters when the queue grows and closes them when it shrinks, provided each cashier can serve any customer without needing to remember who was served before.

10Configuration: App Settings, Connection Strings, and Environments

The same code should run in many environments by changing settings, not code.

App Service lets you set application settings and connection strings in the portal or through automation. These values are provided to your app as environment variables when it runs. Changing a setting normally restarts the app. Settings are stored encrypted at rest and can be marked slot-specific, so that staging and production hold different values.

Item

Application settings

Name and value pairs for your app, such as feature switches, endpoints, and mode names.

Item

Connection strings

Special settings with a type, such as database connections, which some frameworks read in a special way.

Item

General settings

Platform options such as the runtime version, startup command, always on, HTTP version, and minimum TLS version.

Item

Path mappings and storage mounts

Ways to attach external storage, such as file shares, into the app’s file system for shared content.

Item

Default documents and handlers

Which file is served when a folder is requested and how certain file types are processed, mostly relevant on Windows.

1

Keep environment differences in settings

Endpoints, feature switches, and limits live in settings so the same package runs everywhere.

2

Mark environment-specific values as slot settings

Values that must not travel during a swap, such as staging-only endpoints, stay with their slot.

3

Keep secrets out of plain settings

Use Key Vault references instead of copying passwords into settings, as covered in the security chapter.

4

Manage settings through automation

Store them in templates or pipelines so changes are reviewed and repeatable.

i
Good Habit

Treat the portal as a place to look, not as the source of truth. If settings are changed by hand in the portal and also defined in a pipeline, the next deployment may overwrite the manual change, causing confusing behavior.

Simple Analogy

Settings are the notes taped to the shop’s control panel: today’s opening hours, the supplier’s phone number, the price list in use. The shop itself is the same every day, but the notes change what it does in each branch.

11Custom Domains and Certificates

Your app starts with a default address, but customers expect your own name.

Every app gets a default address under the azurewebsites.net domain. To use your own name, such as www.example.com, you add a custom domain to the app and prove that you own it. You create DNS records at your domain provider that point your name to the app, and add a verification record. For the bare domain, you typically use an address record, while for subdomains you use an alias record that points to the default address. Check the current guidance for the exact record types the portal asks for.

Secure connections with certificates

Option 1

App Service managed certificate

A free certificate that App Service creates and renews for supported custom domains. Simple, but with some limits, such as supported domain types.

Option 2

Certificate from Key Vault

Import or reference a certificate stored in Key Vault, so renewals and rotation are managed centrally.

Option 3

Uploaded certificate

Upload a certificate file that you bought from a certificate authority. You must renew and upload it yourself.

Option 4

Certificate bought through App Service

A purchasable certificate option managed with Azure, useful when you want a paid, supported certificate and integration.

1

Choose a tier that supports custom domains

Free and Shared tiers have limits on custom domains and security features.

2

Create DNS records

Point your domain to the app and add the verification record requested by the portal.

3

Add the custom domain to the app

The portal checks the records and confirms ownership.

4

Bind a certificate

Select the certificate and the binding type so that the domain is served over HTTPS.

5

Require HTTPS and set a minimum TLS version

Redirect plain web traffic to secure traffic and refuse outdated, weak protocol versions.

ANTI-PATTERN-01 Avoid
Problem

Uploading a purchased certificate by hand and relying on someone to remember its expiry date.

Why It’s Harmful

When the certificate expires, browsers show frightening warnings, customers leave, and APIs that call your service start failing, often at the worst possible moment.

Correct Approach

Use managed certificates where they fit, or store certificates in Key Vault with automatic renewal and expiry alerts.

Simple Analogy

A custom domain is the signboard with your shop’s real name instead of the mall’s default address label. The certificate is the official license displayed in the window that shows customers you are who you claim to be. An expired license makes customers walk away.

12Networking: Controlling Who Can Reach Your App and What It Can Reach

Networking has two directions: inbound traffic to the app and outbound traffic from the app.

By default, an App Service app has a public address on the internet, and it can call out to the internet. In real projects you often need to limit who can reach the app, and to let the app reach private resources, such as a database that is not open to the public. App Service offers separate features for these two directions, and mixing them up is a very common source of confusion.

Inbound: who can reach the app

Inbound 1

Access restrictions

Allow or deny traffic to the app by address ranges, virtual network subnets, or service tags. A simple firewall in front of the app.

Inbound 2

Private endpoints

Give the app a private address inside your virtual network, and optionally turn off public access, so only private networks can reach it.

Inbound 3

Front door and gateway services

Place Azure Front Door or Application Gateway in front, and restrict the app so it accepts traffic only from them, adding firewall and global routing features.

Inbound 4

Client certificates

Require visitors to present a certificate, for strong, machine-to-machine style authentication.

Outbound: what the app can reach

Outbound 1

Regional virtual network integration

Lets the app make outbound calls into a virtual network, so it can reach private databases and services, and use network rules such as routing and firewalls.

Outbound 2

Hybrid Connections

A relay-based way to reach a specific host and port in another network, such as an on-premises server, without opening inbound firewall ports.

Outbound 3

NAT gateway for stable outbound address

With virtual network integration, a NAT gateway can give all outbound traffic one predictable public address, helpful when partners allow only certain addresses.

Outbound 4

Service endpoints and private endpoints on the target

The destination service, such as a database, can accept traffic only from your integration subnet or through a private address.

flowchart LR
  USER["Users on the internet"] --> FD["Front Door or Application Gateway with firewall"]
  FD -->|Only allowed source| APP["App Service app"]
  subgraph VNET["Your Virtual Network"]
    INT["Integration subnet for outbound calls"]
    PEDB["Private endpoint: Database"]
    PEKV["Private endpoint: Key Vault"]
  end
  APP -->|VNet integration| INT
  INT --> PEDB
  INT --> PEKV
        
FIG 5 — A common secure layout: a protected front door in, and private connections out
NeedFeature directionRight tool
Only my office and a gateway may reach the appInboundAccess restrictions or a private endpoint
The app must call a private databaseOutboundVirtual network integration, with the database on a private endpoint
The app must reach one on-premises serverOutboundHybrid Connections, or virtual network integration with a VPN or private line
The partner needs a fixed address for my callsOutboundVirtual network integration with a NAT gateway
The app must not be visible on the public internetInboundPrivate endpoint with public access disabled, or an isolated environment
!
Common Mistake

Believing that virtual network integration makes the app private. Integration only affects outbound traffic. Inbound traffic still reaches the public address unless you also add access restrictions or a private endpoint. Many “private” apps are, in fact, open to the internet because of this misunderstanding.

Simple Analogy

Inbound networking is who may come through the mall’s front door to visit your shop. Outbound networking is where your staff may go when they leave to fetch supplies. Locking the front door does nothing to control where your staff travel, and giving staff a private tunnel to the warehouse does not lock the front door.

13Identity: Managed Identities and Sign-In for Your Users

Identity answers two questions: how does the app prove itself, and how do users prove themselves?

The app’s own identity

A managed identity is an identity that Azure creates and manages for your app. With it, your app can sign in to other Azure services, such as Key Vault, Storage, and databases that support identity-based access, without storing any password. You give the identity the needed roles on the target service, and the app requests tokens from Azure at run time. There are system-assigned identities, tied to one app, and user-assigned identities, which can be shared by several resources.

Sign-in for your users

App Service has a built-in authentication feature, often called Easy Auth, which sits in front of your code and handles sign-in with identity providers such as Microsoft Entra ID and others. It can require users to sign in before they reach any page, or allow anonymous access and let the app decide. It passes the signed-in user’s information to your app in request headers, so your code does not need to implement the sign-in protocol itself.

Feature

Managed identity for outbound access

Passwordless access from the app to Azure resources, controlled by role assignments.

Feature

Built-in authentication

Sign-in handled by the platform, with support for several identity providers and token storage.

Feature

Authorization rules

Require sign-in for all requests, or only for some paths, and choose what to do for unauthenticated users, such as redirect or return an error.

Feature

Key Vault references

App settings that point to secrets in Key Vault, resolved by the platform using the app’s managed identity.

sequenceDiagram
  participant U as User
  participant FE as App Service with built-in authentication
  participant IDP as Microsoft Entra ID
  participant APP as Your application code
  participant KV as Key Vault
  U->>FE: Request a protected page
  FE-->>U: Redirect to sign in
  U->>IDP: Sign in
  IDP-->>U: Token
  U->>FE: Request with token
  FE->>APP: Forward request with user information in headers
  APP->>KV: Read a secret using the app's managed identity
  KV-->>APP: Secret value
  APP-->>U: Page for the signed-in user
        
FIG 6 — User sign-in handled by the platform, and secret access handled by the managed identity
Simple Analogy

Built-in authentication is a security guard at your shop door who checks each visitor’s ID and tells your staff only the name. The managed identity is your shop’s own staff badge, used to collect goods from the warehouse without carrying cash or keys.

i
Good to Know

Built-in authentication checks that someone is signed in, but your application still has to decide what each user may do. Authentication is not the same as authorization, so keep permission checks inside the app or through roles.

14Security: Layers of Protection

A secure web app is protected at many layers, not by one switch.

Layer 1

Platform security

Microsoft patches the operating system and runtime, isolates apps in sandboxes, and monitors the infrastructure.

Layer 2

Transport security

Require HTTPS only, set a modern minimum TLS version, and consider disabling unused protocols and old deployment methods.

Layer 3

Network controls

Use access restrictions, private endpoints, front door or gateway firewalls, and private outbound paths.

Layer 4

Identity and secrets

Use managed identities and Key Vault references. Avoid passwords in settings and code.

Layer 5

Application security

Validate input, protect against common web attacks, and keep libraries updated. The platform cannot fix insecure code.

Layer 6

Management access

Control who can change the app with role-based access control, and protect the Kudu management site and deployment credentials.

Layer 7

Monitoring and threat protection

Collect logs, and use security tools such as Microsoft Defender for App Service where enabled, to detect suspicious activity.

1

Require HTTPS and modern TLS

Switch on HTTPS only and set the minimum TLS version to a current one.

2

Disable basic publishing credentials and plain FTP

Prefer identity-based deployment methods, and turn off password-based publishing where possible.

3

Use managed identity and Key Vault

Remove passwords from settings and let the app authenticate to Azure services by identity.

4

Restrict inbound access

Put a protective service in front, and limit the app to accept traffic only from it or from private networks.

5

Limit who can manage and deploy

Assign narrow roles, protect production slots, and review role assignments regularly.

6

Log and alert

Turn on diagnostic logs, send them to a central workspace, and alert on unusual errors and sign-in activity.

ANTI-PATTERN-02 Avoid
Problem

Leaving the management site and deployment endpoints reachable from the whole internet, protected only by a shared publishing password.

Why It’s Harmful

Anyone who obtains the password can upload code, read files and settings, and take over the app. Shared passwords leak easily and cannot be tied to a person.

Correct Approach

Disable basic authentication, use identity-based deployments, restrict access to the management endpoints, and keep production changes inside an audited pipeline.

Simple Analogy

Securing an app is like securing a shop. There are locks on the doors, cameras, a guard at the entrance, a safe for the cash, and rules about who can enter the stockroom. A single strong lock helps, but thieves look for the unlocked back door.

15Reliability: Health Checks, Zones, and Regions

Plan for the day something fails, because eventually something will.

Feature

Health check

You give App Service a path to ping regularly. If an instance repeatedly fails the check, it is taken out of the load balancer rotation and may be replaced, so visitors reach only healthy instances.

Feature

Multiple instances

Running at least two instances means one failure or one update does not take the app down.

Feature

Always on

Keeps the app loaded so the first request after quiet periods is not slow. Available in tiers that support it, and important for apps with background work.

Feature

Zone redundancy

On supported plans and regions, instances are spread across separate data center zones, so the loss of one zone does not stop the app. It requires enough instances to spread across zones.

Feature

Multi-region deployment

Run the app in two regions, with a global traffic service in front, to survive a whole-region failure and to serve users from nearby locations.

Feature

Backups

Scheduled backups of app content and configuration, and sometimes connected databases, available on supported tiers.

flowchart TD
  U["Users worldwide"] --> GF["Azure Front Door or Traffic Manager"]
  GF -->|Primary| R1["Region 1: App Service with zone redundancy"]
  GF -->|Failover| R2["Region 2: App Service with zone redundancy"]
  R1 --> DB1["Primary database"]
  R2 --> DB2["Replica database"]
  DB1 -. replication .-> DB2
        
FIG 7 — A multi-region design with global routing and replicated data
Level of resilienceProtects againstCost and effort
Single instanceAlmost nothingLowest
Two or more instancesSingle machine failure and rolling updatesLow
Zone redundancyLoss of one data center zoneMedium, needs supported tier and instance count
Multi-regionLoss of a whole regionHigh, needs data replication and global routing
!
Common Mistake

Designing the web tier for high availability while leaving the database in a single location. The app is only as available as its weakest dependency, so plan resilience for every layer together, and test failover before you need it.

Simple Analogy

A single instance is a shop with one cashier. Two or more cashiers keep serving when one is sick. Zones are separate buildings of the same chain in one city, and regions are branches in different cities. The more spread out, the better the protection, and the higher the cost.

16Monitoring, Logging, and Diagnostics

If you cannot see what the app is doing, you cannot fix it quickly.

Tool

Platform metrics

Numbers such as processor use, memory use, request counts, response times, and error counts, for the app and the plan.

Tool

Application Insights

Application performance monitoring that records requests, exceptions, dependencies, and traces, and maps how components call each other.

Tool

Diagnostic logs

HTTP logs, application logs, platform logs, and console output, which can be sent to a Log Analytics workspace, storage, or an event hub.

Tool

Log stream

A live view of logs in the portal or command line, useful during troubleshooting.

Tool

Diagnose and solve problems

A built-in troubleshooting area with guided checks for common problems such as slow responses, crashes, and configuration issues.

Tool

Kudu and advanced tools

A management site with a file browser, process explorer, and options to capture memory dumps and profiling data for deep problems.

Tool

Alerts and availability tests

Rules that notify you when metrics cross a limit, and tests that call your site from several locations to check that it is reachable.

QuestionWhere to look first
Is the app up and how fast is it?Availability tests and response time metrics
Is the plan out of capacity?Plan-level processor and memory metrics, and instance count
Why did this request fail?Application Insights failures and exception details
Is a dependency slow?Application Insights dependency timings
Why did the app restart?Diagnose and solve problems, platform logs, and activity log
What happened after the last deployment?Deployment history, error rates before and after, and logs
1

Turn on Application Insights

Enable it on the app so requests, errors, and dependencies are recorded from the start.

2

Send diagnostic logs to a central workspace

Keep logs long enough for investigations, and filter noise to control cost.

3

Create alerts

Alert on failure rates, slow responses, high resource use, and failed health checks.

4

Add availability tests

Check the public experience from outside, not only internal metrics.

5

Review after every release

Compare key metrics before and after, and keep a rollback ready.

Simple Analogy

Monitoring a web app is like running a shop with a camera at the door counting visitors, a till record of every sale, and an alarm when the queue gets long. Without them, you only find out about problems when customers complain.

17Performance Tuning

Speed comes from a few well-understood habits.

Tip 1

Keep the app and its data close

Place the app, database, and cache in the same region, to reduce delay on every call.

Tip 2

Turn on Always On and warm-up

Avoid slow first requests after idle periods by keeping the app loaded and warming new instances before traffic.

Tip 3

Use caching

Cache results of expensive operations in a shared cache, and use caching headers for static content.

Tip 4

Use a content delivery network

Serve images, scripts, and other static files from locations near the visitors, so your workers handle only dynamic work.

Tip 5

Use run-from-package deployment

Reduces file system overhead and speeds startup for many apps.

Tip 6

Handle connections carefully

Reuse connections to databases and services, and avoid exhausting outbound connections by creating a new client for every request.

Tip 7

Disable session affinity if not needed

Affinity cookies pin a visitor to one worker, which can cause uneven load. Stateless apps often spread better without it.

Tip 8

Profile before guessing

Use Application Insights and profilers to find the slow step, rather than adding hardware blindly.

1

Measure the baseline

Record typical response times and resource use under normal load.

2

Find the slowest steps

Look at dependency timings and slow requests to see where the time goes.

3

Fix the biggest cause first

Common culprits are slow database queries, missing caches, chatty calls, and large payloads.

4

Load test in a safe environment

Test with a copy of the plan, not against the production plan that real users share.

5

Scale as the last step

Add capacity only after the app is efficient, because scaling a slow design just makes a slow design more expensive.

Simple Analogy

Tuning performance is like speeding up a restaurant. First you find out whether the delay is in the kitchen, in taking orders, or in delivering plates, and fix that. Hiring extra waiters will not help if the bottleneck is a slow oven.

18Background Work: WebJobs and Related Options

Web apps often need to run tasks that are not tied to a visitor’s request.

Many applications must send emails, process files, update reports, or clean data on a schedule. Running these tasks inside a web request makes pages slow and fragile. App Service offers WebJobs, which run background programs in the same plan as the app, and Azure offers other services designed for background work.

OptionWhat it isBest forWatch out for
WebJobs, triggeredA program that runs on demand or on a schedule within the app’s planSmall periodic tasks close to the appShares the plan’s resources with the web app
WebJobs, continuousA program that runs all the time, waiting for workQueue processorsRequires Always On, and runs on every instance unless limited
Azure FunctionsSmall serverless functions triggered by events, timers, or queuesEvent-driven tasks with independent scalingDifferent programming model and hosting choices
Container Apps jobs or other container servicesContainerized background processingHeavier or containerized batch workAnother service to manage
Message queues with worker appsRequests placed in a queue and handled by separate workersReliable, scalable background processingNeeds design for retries and duplicates
flowchart LR
  WEB["Web app handles user request"] -->|Place work item| Q["Message queue"]
  Q --> WK["Background worker: WebJob or Function"]
  WK --> DB["Database or storage"]
  WK --> MAIL["Email or notification service"]
        
FIG 8 — The web app hands slow work to a queue, and a worker finishes it separately
i
Good to Know

Because every instance in a plan runs your app, a scheduled job inside the web app can run on several instances at once, causing duplicate work. Use a queue, a lock, or a single-instance mechanism so that each task runs once.

Simple Analogy

The web app is the front counter serving customers. Background workers are the kitchen staff who prepare orders from a ticket rail. The counter stays fast because it only writes the ticket and hands it over, instead of cooking while the customer waits.

19App Service Environment: The Isolated Option

Some organizations need a private, dedicated home for their apps.

An App Service Environment is a fully isolated and dedicated deployment of the App Service platform inside your own virtual network. Instead of sharing the multi-tenant front ends, you get your own, and you decide whether the environment is reachable from the internet or only from your private network. It supports very large scale and is used where compliance, network isolation, or high scale requires it.

Feature

Network isolation

The environment lives in your virtual network, with an internal or external address as you choose.

Feature

Dedicated infrastructure

Your own front ends and workers, not shared with other customers.

Feature

High scale

Higher limits on the number of plans and instances than the shared platform.

Trade-off

Higher cost and effort

There is a cost for the environment itself plus the plans inside it, and more networking design is needed.

PointMulti-tenant App ServiceApp Service Environment
Infrastructure sharingShared front ends, isolated appsDedicated environment
Network placementPublic service with private optionsInside your virtual network
Scale limitsLower than isolatedHighest
CostLowerHigher
Typical customersMost web workloadsStrictly regulated or very large workloads
i
Practical Advice

Many requirements that used to need an isolated environment can now be met with private endpoints, access restrictions, and network integration on the multi-tenant service. Evaluate those first, and choose the dedicated environment only when you truly need it.

Simple Analogy

The shared service is a shop in a busy public mall with excellent security. The dedicated environment is your own private building inside a fenced campus. It is more private and bigger, but you pay for the whole building even when it is quiet.

20Cost Management for App Service

The plan is the bill. Managing it well saves real money.

You pay for an App Service plan for every hour it exists, regardless of how many apps run on it or how busy they are, based on its tier, size, instance count, and operating system. Extra costs arise from outbound data transfer, custom certificates, backups storage, private endpoints, logging, and connected services.

Lever

Consolidate apps onto fewer plans

Several small apps can share one plan if they fit together, instead of paying for many underused plans.

Lever

Right-size the plan

Check processor and memory use over weeks, and reduce oversized plans or move to a smaller size.

Lever

Autoscale instead of fixed peak capacity

Scale out for busy hours and in for quiet hours, with sensible minimums for resilience.

Lever

Stop or delete unused environments

Delete test plans and slots when not needed. Stopping an app does not stop billing for the plan. Only scaling down or deleting the plan does.

Lever

Use commitments for steady production plans

Reservations or savings plans can lower the price of steady capacity in eligible tiers. Check current options.

Lever

Control logging and data transfer

Filter verbose logs, use a content delivery network for static content, and keep dependencies in the same region.

ANTI-PATTERN-03 Avoid
Problem

Creating a new, separate plan for every tiny app and every environment, and believing that stopping an app stops the cost.

Why It’s Harmful

Each plan bills continuously, many plans run nearly idle, and the bill grows with the number of apps instead of the real workload.

Correct Approach

Group compatible apps in shared plans, right-size them, delete test plans when finished, and review plan utilization monthly.

!
Check Current Pricing

Tier names, sizes, included features, and prices change over time, and new generations of plans appear. Use the official pricing page and calculator before deciding, and review your plan choice at least once a year.

Simple Analogy

Paying for a plan is like renting a mall unit. The rent is due whether the shop is busy or empty, and closing the shop door for a week does not reduce it. Sharing one unit among several small businesses, or moving to a smaller unit, cuts the rent.

21Design Patterns for Web Apps on App Service

Proven layouts solve common needs, so you do not have to invent them.

Simple web app with a managed database

One app in a plan, connected to a managed database, with a managed identity for access, Application Insights for monitoring, and a staging slot for releases. A solid starting design for many projects.

Front door pattern

Azure Front Door or Application Gateway in front of the app, providing a web application firewall, global routing, caching, and a single public entry point, while the app accepts traffic only from that entry point.

Private back end pattern

An app with virtual network integration reaching databases, caches, and storage through private endpoints, with the public access of those services disabled.

Backend-for-frontend with API apps

A web or single-page front end calls separate API apps, each in its own app or plan, so each can scale and release independently.

Queue-based background processing

The web app places work on a queue, and workers process it, which keeps the user experience fast and absorbs bursts of load.

Multi-region active-passive or active-active

Two regions with global routing and replicated data, giving resilience against regional failure and lower delay for far-apart users.

Blue-green with slots

Staging and production slots used for blue-green releases, with warm-up, smoke tests, swaps, and instant rollback.

flowchart TD
  U["Users"] --> FD["Front Door with web application firewall"]
  FD --> WEB["App Service: web front end"]
  WEB --> API["App Service: API"]
  API --> CACHE["Cache"]
  API --> DB["Database via private endpoint"]
  API --> Q["Queue"]
  Q --> JOB["Worker: Function or WebJob"]
  WEB -. identity .-> KV["Key Vault"]
  API -. identity .-> KV
  WEB --> AI["Application Insights"]
  API --> AI
        
FIG 9 — A typical production design built from App Service and supporting services
Simple Analogy

Patterns are like floor plans for shops. You can arrange a shop in a way that has been proven to work, with an entrance, a counter, a stockroom, and a security desk, instead of inventing a layout and discovering the problems after opening day.

22App Service Compared with Other Azure Hosting Options

Choosing the right host early prevents painful migrations later.

OptionWhat it isControl levelChoose it when
App ServiceManaged platform for web apps and APIsMediumYou want simple, always-ready web hosting with built-in scaling, slots, and security
Azure FunctionsServerless event-driven codeLowerYou have small, event-triggered pieces of logic with spiky use
Azure Container AppsServerless containers with microservice featuresMediumYou use containers and want scaling to zero and microservice support without managing clusters
Azure Kubernetes ServiceManaged KubernetesHighYou need full container orchestration control and have the skills to run it
Virtual MachinesServers you manage yourselfHighestYou need full operating system control or run unusual software
Azure Static Web AppsHosting for static front ends with serverless APIsLowerYou build a static or single-page site with simple back-end functions
flowchart TD
  Q1{"Is it a web app or API?"}
  Q1 -->|Small event-driven code| FUNC["Azure Functions"]
  Q1 -->|Static site with small APIs| SWA["Static Web Apps"]
  Q1 -->|Standard web app, code or container| Q2{"Need full container orchestration or special OS control?"}
  Q2 -->|No| APPSVC["App Service"]
  Q2 -->|Container microservices without cluster work| CA["Container Apps"]
  Q2 -->|Full orchestration control| AKS["Kubernetes Service"]
  Q2 -->|Full OS control| VM["Virtual Machines"]
        
FIG 10 — A simple decision path for choosing an Azure hosting service
i
Quick Rule

If your application is a standard web app or API and you do not need special operating system access or container orchestration, App Service is often the simplest and cheapest-to-operate choice.

23Real-World Use Cases

See how different organizations use App Service every day.

An online store handling seasonal traffic

A retailer runs its storefront and API on App Service plans with autoscale. Traffic spikes during sales are handled by adding instances, a content delivery network serves images, and slot swaps allow releases during business hours without downtime.

A bank portal with strict security

A bank hosts an internal portal with private endpoints and access restrictions, built-in authentication tied to its corporate identity service, managed identities to Key Vault and databases, and detailed logging to a central security workspace.

A software company hosting a multi-tenant product

A company runs its product across several regions with global routing in front. Each release goes through staging slots, with canary traffic routing before the full swap.

A university running many small applications

A university places dozens of small department websites on a few shared plans, saving money, while central IT manages certificates, domains, and security settings consistently.

A healthcare provider connecting to on-premises systems

A provider’s patient app uses virtual network integration and a private connection to reach systems in its data center, with a stable outbound address that partners have approved.

A startup moving from virtual machines

A young company migrated its web servers from manually managed virtual machines to App Service, removing patching work, adding slot-based releases, and reducing both cost and outages.

24Advantages and Trade-offs

An honest look helps you decide with open eyes.

Advantages

  • Fully managed platform, so no operating system patching or server administration
  • Built-in scaling, with autoscale, and instance-level resilience
  • Deployment slots for safe releases and instant rollback
  • Managed identities, built-in authentication, and Key Vault integration
  • Custom domains, managed certificates, and flexible networking options
  • Many languages and container support, with strong monitoring tools
  • Several apps can share one plan, which lowers cost

Disadvantages / Trade-offs

  • Less control over the operating system and underlying machines than virtual machines
  • Plan cost runs continuously, even when apps are idle, unless you scale down or delete
  • Apps in a plan share resources, so a noisy app can affect neighbors
  • Some features require higher tiers, which raises cost
  • Networking choices are numerous, and inbound and outbound features are easy to confuse
  • Not ideal for workloads needing custom drivers, unusual software, or advanced orchestration
“App Service gives you the shortest road from code to a secure, scalable web app, as long as you stay on the road it was built for.”

25Best Practices and Mistakes to Avoid

Habits that keep your apps secure, fast, resilient, and affordable.

1

Use Standard or higher tiers for production

Choose tiers that provide slots, autoscale, backups, and the networking features you need, and keep Free and Basic for learning and testing.

2

Run at least two instances for important apps

Spread across zones where supported, and enable health checks so unhealthy instances are removed.

3

Release through slots and pipelines

Build once, deploy to staging, warm up, test, swap, and keep rollback ready. Avoid manual production deployments.

4

Design apps to be stateless

Keep sessions, files, and data in shared services so scaling out and instance replacement are safe.

5

Secure by default

HTTPS only, modern TLS, managed identities, Key Vault references, restricted inbound access, and private connections to data services.

6

Separate environments and plans

Use separate plans or subscriptions for production and non-production, so load tests and mistakes never touch live users.

7

Monitor everything that matters

Application Insights, diagnostic logs to a central workspace, availability tests, and alerts tied to clear owners.

8

Keep runtimes and dependencies current

Track end-of-support dates, update libraries, and test upgrades regularly instead of in a hurry.

9

Manage everything as code

Define plans, apps, settings, and networking in templates, so environments are repeatable and reviewed.

10

Review cost regularly

Consolidate plans, right-size, use autoscale, delete unused resources, and consider commitments for steady plans.

ANTI-PATTERN-04 Avoid
Problem

Storing user uploads, sessions, or other important data on the local disk or in the memory of a single instance.

Why It’s Harmful

When the app scales out, restarts, or an instance is replaced, the data is lost or visible to only some visitors, causing mysterious bugs such as users being randomly logged out.

Correct Approach

Keep state in external services such as storage accounts, databases, and shared caches, and treat each instance as disposable.

ANTI-PATTERN-05 Avoid
Problem

Putting production and non-production apps in the same plan, and running load tests against it.

Why It’s Harmful

Because apps share the same workers, tests or a runaway development app can consume processor and memory, slowing or crashing the production app.

Correct Approach

Separate plans, or even subscriptions, for production and non-production, and load test against a copy of the production design.

ANTI-PATTERN-06 Avoid
Problem

Running a single instance with no health check and no alerts for a business-critical app, and deploying straight to production by editing files.

Why It’s Harmful

Any restart, update, or failure causes visible downtime, a bad change is hard to undo, and nobody learns about problems until customers complain.

Correct Approach

Use multiple instances, health checks, slot-based releases, monitoring, and alerts, and make production changes only through reviewed pipelines.

ANTI-PATTERN-07 Avoid
Problem

Relying on the default settings of a new app for security and performance, such as leaving old TLS versions, plain FTP, and always-off idle behavior unchanged.

Why It’s Harmful

Defaults are designed for easy starts, not for hardened production. Weak protocols and slow cold starts show up at the worst times.

Correct Approach

Review and set security, TLS, deployment, and Always On options deliberately, and keep them in your templates.

26Frequently Asked Questions

Q1What is the difference between an App Service app and an App Service plan?

The app is your actual web application with its code and settings. The plan is the set of virtual machines, with a region, operating system, size, and tier, on which apps run. You pay for the plan, and one plan can host several apps that share its resources.

Q2If I stop my app, do I stop paying?

No. Stopping an app does not stop the billing of its plan, because the plan’s machines still exist. To stop paying you need to scale the plan down to a free option where possible, or delete the plan. This is a common source of surprise charges.

Q3How do deployment slots avoid downtime?

A new version is deployed to a staging slot and warmed up with requests. During the swap, App Service applies production settings, makes sure the new instances respond, and then switches routing. Visitors are sent to already-warm instances, so there is usually no downtime, and the old version stays available for rollback.

Q4Does virtual network integration make my app private?

No. Virtual network integration controls outbound traffic from the app into your network. To make inbound traffic private, you need access restrictions or a private endpoint, and you can disable public access. Many people confuse the two, so always check both directions.

Q5Should I scale up or scale out?

Scale out when you need to serve more concurrent visitors or improve resilience, because it adds more workers. Scale up when each instance needs more memory or processing power, or you need features of a higher tier. Most web apps benefit from scaling out with autoscale, provided they are stateless.

Q6How do I keep passwords out of my app settings?

Turn on a managed identity for the app, give it permission to read secrets in Key Vault, and use Key Vault references in application settings. The platform fetches the secret using the identity. Where possible, use identity-based access to databases and storage so that there is no password at all.

Q7Why is the first request after a quiet period slow?

The app may have been unloaded because of inactivity, so the first request triggers a cold start. Turn on Always On in tiers that support it, configure warm-up paths, use health checks, and keep deployments warm using slots to reduce this effect.

Q8When should I choose App Service over containers or Kubernetes?

Choose App Service when you have a standard web app or API and want the simplest management, with built-in scaling, slots, and security. Choose Container Apps or Kubernetes when you need microservice features, complex orchestration, or specialized container control, and you have the skills to operate them.

27Summary and Key Takeaways

Azure App Service is a managed platform for hosting web apps and APIs, where Azure looks after servers, operating systems, and runtimes, and you focus on your application. The key idea is the separation of the app from the plan: the plan defines the region, operating system, tier, size, and number of workers, and several apps can share it. Requests flow through shared front ends to your workers. Deployment slots allow warmed-up, reversible releases, while scale up, scale out, and autoscale handle growth when apps are stateless. Custom domains, managed certificates, and built-in authentication give a professional front, while managed identities and Key Vault references remove passwords. Networking has two separate directions, inbound access restrictions and private endpoints, and outbound virtual network integration. Reliability comes from multiple instances, health checks, zones, and regions, and good monitoring with Application Insights and alerts keeps you informed. Costs are driven by the plan, so consolidate, right-size, and clean up. Used with these habits, App Service is one of the quickest ways to run a secure, scalable web application in Azure.

Key Takeaways

  • App versus plan — the plan is the paid set of workers and the apps run on it, so several apps can share one plan, and stopping an app does not stop plan billing.
  • Choose the stack and tier on purpose — pick Windows or Linux, code or container, and a tier that provides the features you need, such as slots, autoscale, and networking options.
  • Release safely with slots — deploy once to staging, warm up and test, swap into production, and keep the old version ready for instant rollback.
  • Scale smartly — scale out with autoscale for traffic, scale up for memory or features, and keep the app stateless so extra instances are safe.
  • Separate inbound and outbound networking — use access restrictions or private endpoints for who reaches the app, and virtual network integration for what the app reaches.
  • Remove passwords — use managed identities, Key Vault references, built-in authentication, HTTPS only, and modern TLS, and disable weak deployment methods.
  • Operate it like production — run at least two instances, enable health checks and zone redundancy where available, monitor with Application Insights and alerts, manage everything as code, and review cost and runtime support dates regularly.