2
votes

I have several slots in azure , one for qa, one for staging and one for 'live'. I publish to QA and staging at the same time, once QA is approved, I then want to swap staging with live (so that staging now becomes live).

My question is, as staging is a separate web app in its own right, it has its own settings in the web.config file (db connections, client id, client secret,etc) If I swap, does the web.config swap as well ? so if the settings are different, my 'live' app no longer has the correct settings (it takes on the staging web.config settings)

Is this correct ? how can I retain my live settings when I swap deployment slots ? also, how does this affect webjobs ? I have several of them under the web app, with corresponding app.config settings

1

1 Answers

3
votes

The answer is that you can control if the settings change or stay the same during the swap. Check out the following article: https://docs.microsoft.com/en-us/azure/app-service/web-sites-staged-publishing. From that Article:

Configuration for deployment slots

When you clone configuration from another deployment slot, the cloned configuration is editable. Furthermore, some configuration elements will follow the content across a swap (not slot specific) while other configuration elements will stay in the same slot after a swap (slot specific). The following lists show the configuration that will change when you swap slots.

Settings that are swapped:

  • General settings - such as framework version, 32/64-bit, Web sockets
  • App settings (can be configured to stick to a slot)
  • Connection strings (can be configured to stick to a slot)
  • Handler mappings
  • Monitoring and diagnostic settings
  • WebJobs content

Settings that are not swapped:

  • Publishing endpoints
  • Custom Domain Names
  • SSL certificates and bindings
  • Scale settings
  • WebJobs schedulers

To configure an app setting or connection string to stick to a slot (not swapped), access the Application Settings blade for a specific slot, then select the Slot Setting box for the configuration elements that should stick the slot. Note that marking a configuration element as slot specific has the effect of establishing that element as not swappable across all the deployment slots associated with the app.