Return to site

Azure Deployment Slot Database

broken image
Azure Deployment Slot Database
Software

Azure Functions deployment slots allow your function app to run different instances called 'slots'. Slots are different environments exposed via a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand. Deployment Slots in Azure Websites are a way to minimize the impact of broken deployments. Deployment Slots provides a wide variety of deployment workflows.

  1. how to deploy Azure WebApp,
  2. add deployment slot,
  3. code push to Production and Staging slots
  4. finally, swap the slots

Azure Deployment Slot Database Definition

Design and Architecture of Azure Web App Deployment slots is given on the link below –

Deploy Azure WebApp

  1. Login to Azure Portal – https://portal.azure.com
  2. Deploy Azure WebApp using the New menu
  3. Click on Azure WebApp once it is created, click on 'Deployment slots' and then click on 'Add Slot'
  4. I have slot as 'Staging', and I have chosen not to clone configuration from Production slot. This is being done because we will be deploying different version of the app into both slots.
Deployment
Azure deployment slot database example

Summary –

Production URL – http://sarveshgoel.azurewebsites.net

Meadows

Azure Functions deployment slots allow your function app to run different instances called 'slots'. Slots are different environments exposed via a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand. Deployment Slots in Azure Websites are a way to minimize the impact of broken deployments. Deployment Slots provides a wide variety of deployment workflows.

  1. how to deploy Azure WebApp,
  2. add deployment slot,
  3. code push to Production and Staging slots
  4. finally, swap the slots

Azure Deployment Slot Database Definition

Design and Architecture of Azure Web App Deployment slots is given on the link below –

Deploy Azure WebApp

  1. Login to Azure Portal – https://portal.azure.com
  2. Deploy Azure WebApp using the New menu
  3. Click on Azure WebApp once it is created, click on 'Deployment slots' and then click on 'Add Slot'
  4. I have slot as 'Staging', and I have chosen not to clone configuration from Production slot. This is being done because we will be deploying different version of the app into both slots.

Summary –

Production URL – http://sarveshgoel.azurewebsites.net

Staging Slot URL – http://sarveshgoel-staging.azurewebsite.net

Push code to Production and Staging deployment slots

  1. Launch VSTS and open sample web code. I have update the heading on the page to show – Production text. This will be published to the Production slot. Right click on the solution and click on Publish
  2. Select new profile, select Azure App Service. Choose Select Existing since we will be deploying to existing Azure WebApp
  3. Select the Primary slot – sarveshgoel and the code will be pushed there. We will run similar steps for Staging slot.
  4. Now click on Publish, and wait for the confirmation.
  5. Now browse the URL – http://sarveshgoel.azurewebsites.net and you would see the changes that we did initially

Deploy to Staging Slot now

Now repeat the process for Staging Slot but remember to modify the content of Web page, for example – I would change Production to Staging. Another change will from the steps above to deploy to Staging slot

Swap the Azure WebApp Deployment slot now

Now we have two versions of Web Application running on separate slots, running on their own Web URLs. As explained in the Design and Architecture documentation, purpose of staging slot is to test the code before making it Production.

Please remember, the slots in Production WebApp should be used for Staging environment but not for QA or testing environments.

Now, click on deployment slots on the Azure Portal, click on Swap . Now swap Production with Staging as shown below.

Once you click on Ok, Production becomes Staging and Staging becomes Production within few seconds.

Azure Deployment Slot Database Management

Look at the URLs above, and try using this amazing feature Azure WebApp deployment slot.





broken image