Overview
- Introduction
- How to create
- How to swap
- Conclusion
- References
Introduction
Azure makes it easy to create deployment slots for App Services. It’s available in the Standard or Premium App Service plan mode. Deployment slots are actually live apps with their own hostnames. App content and configuration elements can be swapped between two deployment slots, including the production slot.
Azure customers can easily perform the following steps
- Deploy the web application to an online deployment slot.
- Run the tests on a deployment slot, within the live environment that potential testers are going to use. Testing environment and production environment exist side-by-side and provide the similar environment.
- Perform an internal swapping of the IP addresses of both slots (via load balancing and traffic management for both the nodes — slots)
- Update applications with zero downtime
- Swap back to a previous version of your app instantly, with zero downtime for users.
How to create
Step 1
Go to Azure portal, open your App Service. Click on Deployment Slot - Add Slot.
Step 2
Write a name for slot – if you name it as staging, you can access that using -
yourappname-staging. azurewebsites.net
Step 3
Slot created successfully. You can get its publish profile and publish new changes on the slot.
How to swap
Step 1
Go to the Azure portal >> slot. Now, click on Swap.
Step 2
Choose source and destination slot and click OK. After some time, you will get a notification “Swap operation completed successfully”.
Conclusion
The overall reason to have deployment slots enabled is that it helps your team to run live testing on the production environment, and in case there are some problems on the production slot, it lets you roll back the swap without having to take your application down for maintenance.
References
https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-staged-publishing