Search code examples
azureazure-web-app-serviceazure-configurationazure-deployment-slots

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?


Solution

  • 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.