0
votes

We have a number of different web sites hosted as app services in Azure with two deployment slots (staging and production). We have a number of different app settings and connection strings that are stuck to the different slots and this is working fine when we swap slots.

Recently we enabled Web Server Logging under Diagnostics on our production environment, and now when we have swapped staging and production it has moved to the staging environment.

Is there a way to stick this to production only so we don't have to enable it on both environments?

1

1 Answers

0
votes

Maybe not support to do this on the Azure Portal currently.

It's important that the slot is a regular Azure Web App, it will have its own app settings,log setting, connection string, any other configuration settings and even an scm site (https://mysite-staging.scm.azurewebsites.net) and so on. Azure portal has supported to config App settings and connection strings sticky to the slot, but swap is not about copying the content of the website but more about swapping DNS pointers. DNS change point to slot during the swapping, no setting changes for the WebApp setting if there is no other setting changed on the WebApp. Detail please refer to this blog.

If want to enable the Web server log for WebApp production environment automated , please have a try to use the PowerShell command

Set-AzureRmWebApp -ResourceGroupName "MyResourceGroup” -name "MyWebAppName" -HttpLoggingEnabled $true