Skip to content
Related Articles

Related Articles

Microsoft Azure – Using Deployment Slots For Web App

Improve Article
Save Article
  • Last Updated : 28 Mar, 2022
Improve Article
Save Article

In this article, you will come to know about one of the best features of Microsoft Azure that offers in cloud user environment about the deployment of your own application in web server called deployment slots. Microsoft developed the cloud named Azure in 2008 for managing applications and the functions of networking, databases, Machine learning or AI, and so on.  

Azure, the cloud technology is the application management cloud service that has over 600 services including Azure App services, Virtual networks, SQL databases, cost management, Analytics, and so on. Have you wondered what makes Azure so special in deploying the website app at any medium-regions? Yes, it can be generally said as it offers the format as <app-name><slot-name> to prompt the user that you are viewing the deployment slot under the app type as App Service or Slot. Azure makes sure every client meets their requirements by running its computing operations virtually. One of the great features that Microsoft offers its cloud users is called deployment slots to succeed ever touched wonders in the virtual environment server.

Azure App Service

 

Have you thought ever that what is a deployment slot and how it shines from the hidden place where many people weren’t heard of? Azure has one of the best features called deployment slots that permit you to deploy your web app in API application, Linux, mobile back-end services. Every preference can be altered as while running in Premium, Standard, or Isolated App Services, it is allowed to use a segregated deployment slot which is the live hosting app. Each deployment slot is like a full-fledged App service instance with a production slot as an original App service deployment slot. Many cloud users aren’t aware of deployment slots that offer a great deal of deployment but are known of Azure App services which supports web applications.

Let’s take an example of how and where does the deployment slots are used. Deployment slot can be used by implementing blue-green deployment which is an application release model that gradually transfers the user traffic from a previous version of an application or microservice to a nearly identical new release both of which are running in the production line. Blue-green deployment offers flexibility in using deployment slots at the preferred scaling level.

Blue Green-Deployment – Deployment Slot Example

Step 1: Create an Azure Web App Deployment Target 

Before proceeding to this step, let’s take note of about the common benefit of deployment slots in web apps, so it offers minimized downtime when deploying the application in the production environment. Because of its low downtime, the blue-green deployment process is the best example to show. Azure well supports Octopus deploying service to initiate the process of deployment that integrates the functions of the web applications. So in this, create an Azure web app target using a web application by following the necessary steps that are involved in the octopus deployment region.

 

Step 2:  Create Staging Slot.

The staging plot can be managed by creating a Run an Azure PowerShell Script in which a staging plot can be defined as the phase that represents a stage in a deployment lifecycle. So, use this link to create Azure PowerShell Script here. 

 

When you run the script in the octopus deploy, the result will be like the below:

Azure Service Management – Cloud script from Octopus deploy 

Azure Resource Manager

When you create a staging plot in octopus deploy for Azure, it will be shown as the above dashboard

Step 3:  Deploy Your Package

So here we perform the next step by deploying the package content to the staging plot environment. To ease the way, you can view and finish the steps that will guide you to the operation of Azure Web App Deployment here.

Deploy Packages from Azure: Octopus Deploy, You can enter the name of the deployment slot in the Deployment Slot field, or to use a variable for the Slot name, click the “Bind” button, and enter

Step 4: Swap the Staging and Production Slots in the deployment environment.

Deployment Slots in Azure App Service

 

So yes, this is the final step in the blue-green deployment process that engages with octopus deploy for to understand the use of deployment slots.  Here the aim is to create another Azure PowerShell step process to swap the Staging and Production slots.

To understand, you can view the Azure PowerShell for the swapping.

Azure PowerShell:

Azure Service Management for swapping the staging and Production slots in the Azure PowerShell

Azure Resource Management 

When you perform the current step, your dashboard will be like this below: 

Azure Blue Green

At this point, you should have a working Blue-Green deployment process for your Azure Web App. You can view the whole process below: 

Process of Blue-Green Deployment 

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!