Deployment Slots and Swap
Create staging slots for blue-green deployments, warm up a new release in the staging slot, and swap it into production with zero downtime.
What Are Deployment Slots?
Deployment slots are live, separate environments for an App Service web app, each with its own hostname (e.g., myapp-staging.azurewebsites.net). Slots share the same App Service plan and resources as the production slot but run independently. They enable blue-green deployments — you validate a new release in a staging slot, then swap it into production with zero downtime. Slots are available from the Standard tier and above.
Creating a Deployment Slot
Add a new deployment slot to your web app using the Azure portal or CLI. Each slot gets its own URL, application settings, and connection strings. You can create up to 5 slots on Standard, and up to 20 slots on Premium tier. Common slot names include staging, canary, hotfix, and integration, reflecting different stages of the release pipeline.
# Create a staging deployment slot
az webapp deployment slot create \
--name MyUniqueWebApp \
--resource-group MyRG \
--slot staging
# Deploy code to the staging slot
az webapp deploy \
--name MyUniqueWebApp \
--resource-group MyRG \
--slot staging \
--src-path app.zip
# The staging slot is live at:
# https://MyUniqueWebApp-staging.azurewebsites.net