Azure Website 101: Deployment Slot

We, software developer mainly develop products/features to fulfill the dream of client requirement. And as we work on for them it turns out that testing plays a vital role in the entire process to ensure the development of a perfect solution that matches client requirement. So, testing in QA and UAT, A/B testing all becomes the integral parts of the process. Usually beta/uat/etc testing was carried out in separate environments. On the other hand the production site run on standalone server(s). Once the product pass all the testing phases the developed solution then moved to production server. From our experience we have seen that moving stuff between environments required a series of backups, deployment scripts, scheduled downtime etc.

So, the gist of entire process is that  no matter which deploying strategy (WebDeploy, FTP, git, CI or any other way) you might be using today have the following two major weaknesses

  1. After the deployment completes the website might restart and this results in a cold start for the website, the first request will be slower (can be significant depending on the website) and this can ultimately drop some traffic of your website.
  2. Deploying a bad version of your website often create/opens new hole for hacker. They could take the advantage of your broken code and can mess with your business.

With the introduce of deployment slots azure makes deployment process much more secure and developer friendly. Now within the same website configuration, you can create multiple slots where you can deploy different versions of your code, i.e dev, staging, qa, uat, etc. and can all be accessed through the browser using the right url prefix.

Advantage of deployment slot :

  • By deploying a site to a slot first and swapping it into production ensures that all instances of the slot are warmed up before being swapped into production. This eliminates downtime as the traffic redirection is seamless, and no requests are dropped as a result of swap operations.
  • No backups required! you can seamlessly deploy a slot to production using the Swap operation.
  • Since each slot comes with it’s own separate endpoint URL testing become easier
  • Support of continuous deployment allows to constantly push the latest code to the slot
  • Manually push the changes are also supported.

So, I have already discussed the advantages that you will get from deployment slots. But What are deployment slots actually?

Note to self :

By default each Azure Web App has a single deployment slot called production which is the Azure Web App itself.

How many slots I can have ?

Right now for standard website you could have 4+1 slots for deployment which gives you more deployment options, this is good because you can keep multiple versions of your site and alternate between them while continuing to develop.

Its pretty impressing, How can I create a slot?

Creating a slot is just that easy. Log in to the new portal and from there open the website for which you want to create a slot.

Azure Website 101_Deployment_Slot_01

Clicking the Settings button will open the Settings blade. From there scroll down till you find Deployment Slots(As shown in the following image).

Azure Website 101_Deployment_Slot_02

Eventually this will open up the deployment slot blade. Click the Add Slot

Azure Website 101_Deployment_Slot_03

The first time you add a slot, you will only have two choices: clone configuration from the default slot in production or not at all. After you have created several slots, you will be able to clone configuration from a slot other than the one in production. your-web-app-namedeployment-slot-name will appear at the top of blade to remind you that you are viewing the deployment slot.

Azure Website 101_Deployment_Slot_04

Did you Notice? 

Newly created deployment slot contains NO CONTENT! This is to allow deployment from a different repository branch, or a different repository all together.

In this article we went for a high level overview of deployment slots, why we need this and what are the advantages we could gain from this. However , we have not gone in details how swapping works, how to configure auto swap etc. We will check those out in the upcoming article.

GOOD READS:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s