Every Azure App Service / Azure Web App resource in Microsoft Azure includes the Deployment Slots feature. These deployments slots enhance your ability to implement a streamlined testing, staging, and production deployment process. The use of Deployment Slots enables zero downtime when deploying application changes into production; including the ability to rollback the most recent deployment if necessary.
Creating Deployment Slots
Deployment Slots are a feature of Azure App Service / Azure Web Apps. Every App Service resource (aka Web App) in Microsoft Azure has the ability to create and utilize multiple deployment slots. The number of deployment slots supported will vary based on the pricing tier chosen for the App Service Plan that is hosting the app.
By default, App Service will deploy to a “Production” deployment slot. This is the main, or primary, slot deployed to. If you don’t configure any additional deployment slots, then you wont really notice anything. But, when you create additional deployment slots, you will notice a deployment slot named “Production”.
Each App Service (in Standard tiers) can have up to 4 additional Deployment Slots in addition to the Production slot.
Each Deployment Slot allows for a separate instance of the application to be hosted in isolation from the other deployment slots and production slot of the App Service. The VM behind each Deployment Slot is the same VM Instance that hosts the production deployment slot. This means that the App Service and 4 additional Deployment Slots will all be hosted in and share the same VM Instance and resources.

To create App Service Deployment Slots in the Azure Portal, just navigate to the Web App resource, select the Deployment slots section and click the Add Slot button to create a new Deployment Slot.
Additionally, in order to use the Deployment Slots feature of Azure App Service, the pricing tier must be either Standard or Premium. The Free, Shared, and Basic pricing tiers do not support deployment slots.
IMPORTANT: All Deployment Slots for the same App Service / Web App will share the same underlying VM / Compute resources.
Deployment Slot URL / Endpoint
Azure App Service applications get a unique URL that is made up of the App Service Name as the subdomain of the azurewebsites.net domain. In the above screen shot, the App Service Name is “b59-eus-webapp” which means the URL / endpoint for the Production slot of the App Service is located at b59-eus-webapp.azurewebsites.net.
When creating Deployment Slots each slot gets it’s own URL / Endpoint. The endpoint for each deployment slot derives from the endpoint for the Production slot by appending the name of the deployment slot with a hyphen.
With an App Service named “b59-eus-webapp” the URL / Endpoint for the following deployment slots will have the following values:
- dev => b59-eus-webapp-dev.azurewebsites.net
- test => b59-eus-webapp-test.azurewebsites.net
- stage => b59-eus-webapp-stage.azurewebsites.net

Deployment Slot Swapping
Swapping Deployment Slots is the method of copying the currently deployed application code and settings of one deployment slot and swapping it with another. Swapping allows for the deployment of application code to be done from one environment to another very quickly. It also allows for a couple new deployment techniques that didn’t exist in traditional server hosting.
To swap Deployment Slots from the Azure Portal, just navigate to the list of Deployment Slots for an App Service or navigate to the specific Deployment Slot that needs to be swapped. Then, click the Swap button and specify which Deployment Slot to swap with. See the above screenshots for reference of where the Swap button is located within the Azure Portal.
When an application is deployed using Deployment Slot swapping, there is zero downtime
When an application is deployed using Deployment Slot swapping, there is zero downtime of the application. The way this is implemented is by just rerouting the Deployment Slot Endpoint between the Deployment Slots being swapped. Both deployment slots remain running and actively responding to client requests throughout the swap.
Staged Deployment
The technique of performing a Staged Deployment allows for application code to be deployed to a non-production deployment slot (such as one named stage) to test or verify functionality is working as expected. Then once everything has been verified, the Stage deployment slot can be swapped with Production making the staged application deployment the new Production instance of the application.
Incremental Deployment
There are times when deploying application changes might require additional changes other than just deploying the latest code. These requirements could be running SQL scripts or some other post deployment step necessary to fully deploy the latest code. Deploying to a Stage deployment slot can allow for these Incremental steps to be performed after the code is deployed in a way that can be tested and verified before deploying to production.
Rollback Deployment
Every once in awhile a deployment fails for some reason. Maybe files end up corrupt, a major bug is found, or some other reason for failure. In these cases, it’s necessary to rollback a deployment. Using Deployment Slots, a deployment can be rolled back easily buy just swapping the Deployment Slots back.
Basically, swap Stage with Production to deploy new changes. When a major bug is found that requires a rollback, then the Production and Stage Deployment Slots can be swapped back. This allows for the old application code to be rolled back into Production in a matter of minutes. This leads to greatly decreased downtime in the event of a deployment failure.
Article Updated: December 6, 2023
Original Article Source: Deploy Azure App Service / Web Apps with Deployment Slots for Reduced Downtime written by Chris Pietschmann (If you're reading this somewhere other than Build5Nines.com, it was republished without permission.)
Microsoft Azure Regions: Interactive Map of Global Datacenters
Prompt Noise Is Killing Your AI Accuracy: How to Optimize Context for Grounded Output
Create Azure Architecture Diagrams with Microsoft Visio
IPv4 Address CIDR Range Reference and Calculator
Unlock GitHub Copilot’s Full Potential: Why Every Repo Needs an AGENTS.md File






Reblogged this on The Flying Maverick.