AZ-204 Developing Solutions for Microsoft Azure Exam
You can develop, but can you develop for the cloud? Harness your development skills and learn how to create robust solutions for Microsoft Azure, aiming for your Microsoft Certified: Azure Developer Associate certification!
Practice Test

Practice Test

Configure deployment slots
Explore Deployment Slot Configuration and Management
Azure App Service deployment slots are additional live environments attached to your main application. Each slot runs alongside the production slot and has its own URL, letting you test updates without affecting real users. By deploying new code to a staging slot first, you can verify functionality and catch issues before swapping into production. This setup supports a zero-downtime release process because traffic is rerouted seamlessly. Understanding slots helps maintain high availability and build confidence in each release.
To create a deployment slot, you can use different tools that fit your workflow:
- Azure Portal for a graphical, point-and-click experience.
- Azure CLI with
az webapp deployment slot create --name <app-name> --resource-group <group-name> --slot <slot-name>
. - Azure PowerShell using
New-AzWebAppSlot -ResourceGroupName <group-name> -Name <app-name> -Slot <slot-name> -AppServicePlan <plan-name>
.
When creating a slot, you can choose to clone configuration from an existing slot or start with fresh settings. Each new slot appears as a separate app in your resource group, making it easy to manage independently.
A staging slot is where you enable continuous deployment and run smoke tests to ensure stability. You can warm up this slot by sending test traffic and confirming performance before going live. The production slot should have continuous deployment disabled to avoid unexpected updates. When you’re ready, perform a swap to exchange the content and configurations between slots. This swap process warms up instances, restarts apps, and directs traffic to prevent any downtime.
Each slot can have its own app settings and connection strings, which you mark as slot settings to keep them tied to that environment. During a swap, App Service preserves these slot settings, ensuring that database connections or secret keys remain correct for each slot. This separation helps prevent configuration drift and reduces the risk of leaking sensitive data. If any issues arise after swapping, you can quickly roll back by swapping again. Proper management of slot-specific values streamlines deployments and supports rapid recovery.
Conclusion
Azure App Service deployment slots allow you to test and validate code in a side-by-side environment, supporting zero-downtime releases and high availability. By adding staging and production slots, you can catch issues early, warm up instances, and swap confidently.
Using tools like Azure Portal, Azure CLI, and PowerShell simplifies slot creation and lets you choose between cloning configuration or starting fresh. This flexibility ensures each slot’s settings and secrets are handled correctly.
Managing slot-specific app settings and connection strings prevents configuration drift, keeps sensitive data secure, and provides a quick rollback path if needed. Deployment slots are a key practice for reliable, efficient, and safe Azure App Service deployments.