Web App Service field-manual-complete field-manual-complete

Deployment slot

A deployment slot is a live App Service environment beside production, usually named staging, preview, or blue. It has its own URL and configuration surface, but it runs under the same App Service app family and plan. Teams deploy a new version to the slot, warm it up, run smoke tests, and then swap it with production. Slots make releases safer because promotion becomes a controlled swap instead of overwriting the production app in place while users are already connected.

Aliases
App Service deployment slot, Azure App Service slot, Deployment slot, always-on, app-service, app-service-app-setting, app-service-logs, app-service-plan, container-apps-revision, deployment slot, deployment-slot, deployment-slot-swap, github-actions-deployment, production-slot, slot-setting, staging slot, staging-slot, web app slot
Difficulty
intermediate
CLI mappings
5
Last verified
2026-05-30

Microsoft Learn

Microsoft Learn describes App Service deployment slots as live apps with their own host names. You can deploy a web app, API app, mobile backend, or Linux web app to a nonproduction slot, validate it, then swap content and configuration with production.

Microsoft Learn: Set up staging environments in Azure App Service2026-05-30

Technical context

Technically, deployment slots belong to Azure App Service apps on supported plan tiers. Each slot has a hostname, app content, app settings, connection strings, managed identity behavior, deployment source, diagnostic settings, and swap configuration. Some settings are sticky to a slot, while others move during a swap. Slots interact with Always On, health checks, custom domains, TLS, deployment pipelines, authentication, private endpoints, and Application Insights. They are control-plane resources used to manage live runtime state during application releases.

Why it matters

Deployment slots matter because release failures usually hurt most when they happen directly in production. A slot gives teams a place to deploy the exact build, validate dependencies, warm caches, check startup, and confirm configuration before customer traffic moves. Swaps also provide a fast rollback path when the old production version remains in the opposite slot. Without slots, teams often rely on manual timing, risky file replacement, or emergency redeployment. Good slot discipline reduces failed launches, makes release evidence easier, and gives business owners more confidence when approving changes during busy periods. That safety becomes critical when releases touch payments, identity, or persistent data.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In the App Service Deployment slots blade, you see slot names, hostnames, traffic status, swap actions, and configuration surfaces for staging or preview releases. during release reviews.

Signal 02

In az webapp deployment slot list output, slot names and states confirm which live slot environments exist before a pipeline deploys or swaps. during swap reviews.

Signal 03

In app settings and connection strings, slot setting flags show which values stay with a slot instead of moving during swap. during release safety reviews.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Deploy a new web app build to staging, warm it up, and swap only after health checks pass.
  • Roll back a failed release quickly by swapping production back to the previously stable slot.
  • Keep production connection strings sticky while candidate code moves between staging and production.
  • Run smoke tests against a live App Service hostname without exposing the candidate build to all users.
  • Separate release approval evidence from build deployment evidence during regulated application changes.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Travel portal avoids holiday booking outage

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A travel booking portal needed to release a new itinerary engine before a holiday sale. Previous in-place deployments caused cold starts and intermittent login failures during peak searches.

Business/Technical Objectives
  • Warm the new itinerary engine before customer traffic arrived.
  • Keep production login settings isolated from staging validation.
  • Rollback within ten minutes if booking errors increased.
  • Capture release evidence for the change advisory board.
Solution Using Deployment slot

The team created a staging deployment slot for the App Service web app and marked production connection strings, authentication secrets, and payment endpoints as slot settings. The release pipeline deployed the new build to staging, ran smoke tests against login, search, booking, and confirmation pages, then collected Application Insights metrics from the staging hostname. Always On and a warm-up endpoint loaded the itinerary cache before the swap. After approval, operators used Azure CLI to swap staging with production and kept the previous production version available in the other slot. When a minor browser error appeared, the team fixed it in staging without touching production and completed a second controlled swap.

Results & Business Impact
  • Holiday-sale launch completed with no booking outage and no emergency redeploy.
  • First-request response time after swap improved from 4.8 seconds to 900 milliseconds.
  • Rollback readiness was documented before promotion and tested in seven minutes.
  • Change evidence collection dropped from six manual screenshots to one scripted export.
Key Takeaway for Glossary Readers

Deployment slots let App Service teams warm, verify, and promote releases without gambling on direct production replacement.

Case study 02

Legal case platform protects production data

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A legal technology provider used staging slots but accidentally let candidate builds connect to production document storage during testing, creating audit findings after every major release.

Business/Technical Objectives
  • Keep staging validation away from production document repositories.
  • Prevent secret and connection-string movement during slot swaps.
  • Reduce recurring release audit findings to zero.
  • Make slot configuration review repeatable for every deployment.
Solution Using Deployment slot

Engineers reviewed the App Service slot configuration and marked production storage, search, and signing-service connection strings as slot settings. The staging slot received separate test dependencies and access restrictions that allowed only corporate and pipeline networks. Azure CLI commands exported app settings and connection string metadata before each swap, and the pipeline failed if expected sticky settings were missing. The operations team also documented which custom domains, certificates, and authentication providers belonged to production. During swap, application content moved forward while sensitive production configuration stayed with the production slot, preventing candidate validation from touching real client documents.

Results & Business Impact
  • Release audit findings related to slot configuration dropped from seven per quarter to zero.
  • Staging tests no longer generated production document access events.
  • Pre-swap configuration review time decreased from ninety minutes to twelve minutes.
  • Emergency rollback remained available because the previous content stayed in the alternate slot.
Key Takeaway for Glossary Readers

A deployment slot is safe only when sticky settings and access boundaries are treated as part of the release design.

Case study 03

Nonprofit donation site rehearses rollback

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A nonprofit expected a national fundraising campaign to create a tenfold traffic spike and wanted a predictable rollback path for its donor checkout app.

Business/Technical Objectives
  • Deploy the new donation flow without interrupting active donors.
  • Validate payment, email receipt, and fraud-check dependencies before swap.
  • Keep the previous production version ready during the campaign.
  • Reduce release stress for a small operations team.
Solution Using Deployment slot

The small platform team created a staging slot and embedded slot checks into a GitHub Actions workflow. The workflow deployed the candidate donation build, called health endpoints, submitted test donations against nonproduction payment credentials, and checked Application Insights dependency failures. Operators confirmed App Service plan headroom before running promotional traffic tests, then swapped staging into production from Azure CLI. The old production build remained in the staging slot with a named rollback command in the incident channel. After the campaign, the team cleaned up stale slot settings and exported evidence for donors and board reporting.

Results & Business Impact
  • Donation checkout availability stayed above 99.95 percent during the campaign.
  • The team completed a rollback drill in six minutes before launch day.
  • Payment dependency failures were caught in staging and fixed before donors saw them.
  • Operations handoffs dropped from three people on a bridge call to one scripted approval.
Key Takeaway for Glossary Readers

Deployment slots give even small teams a professional promotion and rollback process for high-pressure web releases.

Why use Azure CLI for this?

As an Azure engineer, I use Azure CLI for deployment slots because release safety depends on exact state, not memory. CLI commands let me list slots, inspect settings, create a staging slot, set slot-specific configuration, swap with production, and export evidence for change management. The CLI is also useful in pipelines because every environment promotion can run the same checks before traffic moves. During incidents, I can quickly see which slots exist, what settings are sticky, which hostname is live, and whether a rollback swap is safer than rebuilding production under pressure. That evidence helps release managers trust automation instead of memory.

CLI use cases

  • List deployment slots and confirm staging exists before a pipeline attempts to deploy candidate code.
  • Create a staging slot consistently with the approved name, plan, and configuration baseline.
  • Set slot-specific app settings or connection strings so production secrets do not move during swap.
  • Swap staging with production from a controlled release step and capture the command output as evidence.
  • Delete abandoned slots after confirming no hostname, deployment source, or rollback requirement depends on them.

Before you run CLI

  • Confirm tenant, subscription, resource group, web app name, slot name, and App Service plan tier.
  • Check permissions because creating, configuring, deleting, or swapping slots can affect production traffic.
  • Review sticky settings, connection strings, authentication, custom domains, and private endpoint behavior before swapping.
  • Confirm health checks, warm-up path, monitoring dashboards, and rollback owner before executing a production swap.
  • Use JSON or table output deliberately, and avoid printing sensitive connection strings in shared logs.

What output tells you

  • Slot list output confirms which named live environments exist and whether the expected staging slot is available.
  • Configuration output shows app settings, connection strings, and slot-setting flags that control swap behavior.
  • Swap command output confirms the source and target slots involved in the promotion or rollback action.
  • Hostnames and state fields help verify which slot should receive smoke tests before production promotion.
  • Deployment and diagnostic fields connect a slot to build evidence, monitoring data, and release ownership.

Mapped Azure CLI commands

Deployment slot CLI commands

direct
az webapp deployment slot list --name <app-name> --resource-group <resource-group> --output table
az webapp deployment slotdiscoverWeb
az webapp deployment slot create --name <app-name> --resource-group <resource-group> --slot <slot-name>
az webapp deployment slotprovisionWeb
az webapp config appsettings set --name <app-name> --resource-group <resource-group> --slot <slot-name> --settings <key>=<value>
az webapp config appsettingsconfigureWeb
az webapp deployment slot swap --name <app-name> --resource-group <resource-group> --slot <source-slot> --target-slot production
az webapp deployment slotoperateWeb
az webapp deployment slot delete --name <app-name> --resource-group <resource-group> --slot <slot-name>
az webapp deployment slotremoveWeb

Architecture context

In architecture reviews, I treat a deployment slot as the release boundary for App Service. It is not a separate environment in the full networking or compliance sense unless the supporting settings are designed that way. The slot shares plan capacity and many app-level assumptions, so architects must define which settings stick to production, which move with content, and how identity, connection strings, private endpoints, and authentication behave during swap. A strong design includes warm-up paths, health checks, smoke tests, traffic routing, rollback commands, and approval gates so the slot supports controlled promotion instead of becoming a forgotten second production.

Security

Security for deployment slots focuses on configuration isolation and release authority. A staging slot may accidentally point at production data, expose preview code through a public hostname, use weaker authentication, or carry secrets during a swap. Review RBAC, deployment credentials, slot-specific settings, connection strings, managed identities, authentication providers, private endpoints, and access restrictions. Protect nonproduction hostnames if they can reach sensitive systems. Anyone who can swap slots can effectively promote code to production, so swap permissions should be treated like production deployment rights and monitored carefully. Review each slot because preview endpoints can expose code, credentials, or test data early.

Cost

Deployment slots can increase cost indirectly because they run on the App Service plan and consume compute, memory, storage, logs, and dependency calls. A slot used only during releases may be cheap, but permanent slots with Always On, warm replicas, testing traffic, or heavy diagnostics can consume real capacity and affect production headroom. Costs also appear through duplicate staging databases, extra private endpoints, monitoring retention, and failed release labor. FinOps reviews should identify which slots are needed, how long they stay warm, and whether nonproduction slots should use reduced settings. Include staging activity in capacity plans because shared plan usage still consumes budget.

Reliability

Reliability improves when slots are used for warm-up, smoke testing, and rollback, but only if configuration is correct. A slot that uses the wrong connection string, missing sticky setting, disabled health check, or different runtime stack can pass shallow tests and fail after swap. Operators should validate startup, dependency access, health endpoint, Always On behavior, authentication, and logs before promotion. The previous production version should remain available long enough to support a rollback swap. Reliability also depends on App Service plan capacity because both slots can consume resources during deployment windows. Rehearse swap-back before release night so recovery is not improvised.

Performance

Performance benefits come from warming and validating the new version before production traffic arrives. A slot can expose slow startup, missing dependencies, cold caches, runtime stack problems, or poor health checks before a swap. Performance can also suffer if staging load tests compete with production for the same App Service plan resources. Operators should watch CPU, memory, response time, private bytes, HTTP queue length, dependency latency, and warm-up endpoint behavior across slots. A good swap process proves the candidate slot is ready and that the plan has enough headroom during the release. Test repeatedly. Warm realistic paths before swapping so customers do not pay the startup penalty.

Operations

Operations teams use deployment slots to standardize release checks and rollback procedures. A runbook should list slot names, hostnames, sticky settings, required app settings, warm-up endpoints, diagnostics, approval gates, and swap commands. Operators inspect slots before deployment, after deployment, before swap, after swap, and during cleanup. Evidence should include build version, slot configuration, health check results, Application Insights signals, and rollback readiness. Slots also need ownership because stale staging content, forgotten credentials, or unmonitored preview endpoints can become production risks even when traffic is low. Document slot ownership before swaps because support, audit evidence, rollback, and approvals depend on it.

Common mistakes

  • Forgetting to mark production-only connection strings as slot settings before swapping staging into production.
  • Assuming a staging slot is private just because users do not know its hostname.
  • Testing only the homepage and missing authentication, background jobs, private endpoints, or dependency calls.
  • Running load tests against staging without checking App Service plan headroom for production traffic.
  • Deleting the old production slot immediately after swap and losing the fastest rollback path.