.NET › CI/CD, Publishing & Deployment
How does deployment slot swapping (e.g., Azure App Service deployment slots) enable near-zero-downtime deployments?
AdvancedAnswer
Deployment slots let you deploy a new version to a separate, fully warmed-up staging slot (with its own URL for testing) and then perform an atomic swap that exchanges the staging and production slot's routing, making the new version live instantly with the previously-production version now sitting in staging (as an instant rollback target) -- avoiding the cold-start delay and brief unavailability of a traditional stop-deploy-start deployment.
az webapp deployment slot create --name myapp --resource-group myapp-rg --slot staging
az webapp deployment source config-zip --resource-group myapp-rg --name myapp --slot staging --src ./publish.zip
# After verifying staging slot works correctly:
az webapp deployment slot swap --resource-group myapp-rg --name myapp --slot staging --target-slot productionReal-world example An e-commerce site deploys a new version to a staging slot, runs automated smoke tests against its dedicated URL, and only then swaps it into production, keeping the previous version instantly available in the staging slot for immediate rollback if any issue is discovered post-swap.