ConfigurationManager.AppSettings returning different values in different environments

2

I do not know what to post to help with the question, so if you want to know more, just talk in the comments.

In web.config , within appSettings , has the tag <add key="apiManagerUrl" value="http://minha-api.azurewebsites.net/api/" /> . I am trying to get the Azure service from the Azure service, but I can not find the Azure service.

I know that https://microsoft-apiapp37dce4952f834c67996305734fc0303e.azurewebsites.net/api/ is being updated when I publish the service because I needed to change the web.config tag to identify the problem. Both customErrors and the service you need to call it are published in Azure.

    
asked by anonymous 18.06.2016 / 00:13

1 answer

2

Within your WebApp, in the "AppSettings" option, you will find not only host-relevant settings such as the .NET Framework version, but also some transformations that your web.config should experience after being published.

And this is so cool! Because you can, and should, keep settings locally so that your application, at development time, is set up for your local / dev environments. And by posting, it will automatically point to the respective targets as, if it's a testing environment, it will turn your web.config to its test APIs or databases. And the same is then published in production.

This will not happen if you forget to change the settings before uploading an application.

    
20.06.2016 / 13:08