0
votes

With an Azure App Service, there is the possibility to overwrite setting values for Application Settings and Connection strings.

In the web.config, we have a custom HttpModule (in particular it is HttpAuthModule) which can have its own key/value settings. I suppose the same could occur for any config section such as logging frameworks etc.

How can we overwrite these keys (that live outside of appSetting section) in Azure App Services? We want a different value for different environments (different app services).

3

3 Answers

0
votes

I think I understand your requirements, you want to just rewrite the config file host in the azure without updating the config file.

You could get it with the portal, there is a tool called "App Service Editor" in preview that lets you edit any of the files you've deployed. Config and app settings are exposed via the portal as well and can be modified without dropping to the app service editor tool.

enter image description here

enter image description here

0
votes

I was able to do this through our deployment process (Azure Devops) and the Tokenize in Archive task (free on the marketplace).

Add variables of the same name, but different environment scopes in the variable section, and then have the first task for deployment in each environment run the tokenize task to replace where appropriate in the config file (not limited to the appSettings section).

Screenshot of release process

0
votes

Have you looked at using Azure Resource Manager (ARM) templates for your deployemnts?

Can get a jump start by hitting the Export Template blade in the portal on your app service, though this isn't ideal as it will hardcode some of the specifics (subscription, resource group, etc..) ALso here is some of the quickstart templates

Essentially the deploy.json will be the "template" and will have a separate environment parameters.json file containing those settings specific to your application.