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!
Azure App Service deployment slots are individual, live instances of your web application that run within the same App Service plan. These slots act as staging environments that allow developers to deploy and test new versions of an application before making them public. Because each slot has its own unique hostname and URL, you can run tests safely without affecting your active users. This architecture ensures a smooth deployment process and helps you achieve a deployment with zero downtime.
Developers can create and manage deployment slots using several administrative tools. You can use the Azure Portal for a visual interface, or use command-line options like the Azure CLI and Azure PowerShell to automate the process. When creating a new slot, you can choose to clone the configuration from an existing slot or build one with brand new settings. Each slot appears as a distinct app resource in your resource group, allowing you to manage and secure them independently.
Deployment slots make it easy to separate your development lifecycle into production and staging environments. Best practices recommend enabling continuous deployment on your staging slot so new code changes deploy automatically for immediate testing. In contrast, you should disable continuous deployment on your production slot to prevent unverified updates from accidentally going live. When your staging code is fully verified, you perform a swap to exchange the contents of the staging and production slots.
When you configure an app, you must understand which settings travel with your code during a swap and which stay behind. Slot-specific settings, also known as sticky settings, are configurations tied directly to a specific slot environment that never change during a swap. These include critical environment configurations like custom domains, SSL certificates, publishing endpoints, and IP restrictions. In contrast, non-slot-specific settings represent general application settings that swap automatically to ensure the new application version runs with its matching configuration.
To make a database connection string or environment variable sticky, you must mark it as a deployment slot setting in the Azure portal. You must configure these settings across all slots involved in the swap to prevent application errors caused by missing configurations. During a swap, the source slot temporarily applies the target slot's settings and restarts its instances to verify stability. If any instance fails to start up properly during this phase, Azure automatically rolls back the entire swap to protect your active environment.
A standard slot swap instantly exchanges the content and configuration between your source and target slots. For greater control, you can use swap with preview, which pauses the swap process after applying production settings but before routing actual user traffic. This pause allows developers to validate the app under true production configurations, giving them the option to complete the swap or reset it to the original state. Alternatively, you can configure auto swap to automatically trigger the exchange as soon as new code is pushed and the instances are successfully warmed up.
Traffic routing allows you to perform testing in production by directing a specific percentage of user traffic to a non-production slot. This technique is highly effective for monitoring how a new application version performs with a real audience before a full release. You can use the Azure portal to manually adjust the routing percentage to support different testing strategies:
A system architecture diagram showing user traffic routed by Azure App Service traffic routing to a production slot and a staging slot, illustrating canary testing with a small percentage of traffic directed to the staging slot for monitoring.
Prepare and test your skills

Prepare and test your skills

Azure App Service deployment slots are individual, live instances of a web application that run within the same App Service plan and act as staging environments. Their primary purpose is to allow developers to deploy and test new application versions safely before making them public, which helps achieve a deployment with zero downtime.
Slot-specific settings, also known as sticky settings, are configurations tied directly to a specific slot environment that do not change during a swap, such as custom domains and SSL certificates. Non-slot-specific settings are general application settings that swap automatically to ensure the new application version runs with its matching configuration.
A standard slot swap instantly exchanges content and configuration between slots. Swap with preview pauses the process after applying production settings but before routing traffic, allowing for validation. Auto swap automatically triggers the exchange as soon as new code is pushed and the instances are successfully warmed up.