I'm sure - it's very common Q, but I'm new with Azure and don't sure how correctly even google this question.
So - here we have some App service with URL site.com
. It have "swap" slot, with URL site-staging.com
.
Our deployments scheme is:
CI server > deploy to STAGING > check > if ok then swap to PROD
Questions is: in file Web.staging.config
- we have:
key="ida:PostLogoutRedirectUri" value="http://site-staging.azurewebsites.net/admin"
But. After "swap" will be done - URL will be changed to "http://site.azurewebsites.net/admin", while in Web.staging.config
- it still will use old value - "http://site-staging.azurewebsites.net/admin".
So - after user will open "http://site.azurewebsites.net/admin" and log in - he will be redirected to "http://site-staging.azurewebsites.net/admin" (taken from Web.staging.config
), what is obviously wrong direction.
On similar setup in AWS for example - I'd try to use some variables in my "shell-swap-scripts", to determine that staffs and change config values.
But what about Azure's swapping?
Any tips appreciated.
For all settings that change between slots, the best practice is to configure app settings and connection strings from the Azure portal and not using different web.config files. All settings defined in the portal override the values that may be present in the web.config file (for app settings and connection strings).
You can also define specific-slot settings.
Hope this helps,
Julien