Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do deployment slot settings work on an Azure App Service?

For a given web app service, when multiple deployment slots are setup, e.g.:

myapp

myapp/staging

and I create an appSetting that is marked as a "deployment slot setting" on myapp, what happens when I swap slots? Does the deployment slot setting stay with myapp or does it move to myapp/staging?

Also, what happens if I mix and match deployment slot settings and non-deployment slot settings between deployment slots?

like image 749
joelmdev Avatar asked May 20 '21 20:05

joelmdev


People also ask

What does deployment slot setting mean?

Deployment slots are live apps with their own host names. App content and configurations elements can be swapped between two deployment slots, including the production slot.

What is an App Service deployment slot?

Azure deployment slots allow your web apps to function in different instances called slots. Slots are different environments accessed through a publically available endpoint. One app instance is always assigned to the production slot, where you can toggle between multiple app instances on demand.

How many deployment slots does Azure app have?

At the moment, we have only one deployment slot and it is the production slot. 100% of the traffic is going to this one production slot. To add a new deployment slot, click Add Slot button at the top.


1 Answers

Marking a setting as a "deployment slot setting" keeps it sticky to that particular deployment slot - e.g. an app setting marked as a "deployment slot setting" on myapp will always stick with myapp and will never move to myapp/staging during a swap. If the setting is not set as a deployment slot setting, it will move from myapp to myapp/staging during a swap.

AppSettings are NOT shared or synced across deployment slots. If you want an app setting on more than one slot, you need to add it to all of the slots in question with the same value (assuming you want the same value across all slots).

In terms of mixing & matching whether or not a given app setting is a deployment slot setting, Azure won't let you do this - it's last in wins. For example, if you have an app setting named myAppSetting that is present on more than one slot and you mark it as a deployment slot setting on any one of them, it will be changed to a deployment slot on the others as well, and vice versa. Worth noting that there's no warning or error message when you do this, it just happens silently.

like image 90
joelmdev Avatar answered Oct 19 '22 23:10

joelmdev