0
votes

I have a ASP.NET Web Application running in Azure. In my webconfig file I have some appsetttings values that I won't to be diffrent on diffrent enviroments.

In the Azure Portal I go to my App service, click on configuration and add the values. I add them with the same name as in my webconfig.

When I check in my code I have an automatic deployment. My deployment is working but the values in my webconfig file are not replaced.

In addition after the deployment is complete, all the settings I had entered in the portal are gone.

What am I missing? Do I need to add a step in my deployment (azure dev ops) to replace these settings? Why do the settings get removed after the deployment? and what exactly does the checkbox "Deployment Setting Slot" do?

UPDATE: After looking at my release Pipeline and going to:

Pipeline > Tasks > Azure App Service deploy > Application and Configuration Settings

and adding the settings, after a deployment the values are no longer missing - great.

However, when I look at the actual Web.config file the values are NOT being replaced with the ones in Azure.

App Service > settings > configuration

so now I can see the values I want, but they are not ending up in the web.config file.

Any ideas?

1
Azure app settings override the values in the configuration file. They don't replace them. If the values you're setting on your web app are being removed or replaced with incorrect values, that's a different problem, one related to your deployment process. You need to provide details on how you've automated your provisioning and deployment process if you want help with that.Daniel Mann
@DanielMann - please see the updated questionAyo Adesina
My comment still stands: Azure app settings do not replace the values in the web.config. They override the values at runtime. Basically, the values in the web.config become irrelevant. You don't see the web.config changing because that's not supposed to happen.Daniel Mann
@DanielMann - Yeah, now I get it... I actually had it working the way I wanted, but I didn't realise that the webconfig file wasn't changed, but at run time it will use the values in the portal... thanks Dan...Ayo Adesina

1 Answers

1
votes