3

As far as I know we can store connection strings in azure Applications settings under Connection string section. My question is, can we store below configuration in Application settings.

"IdentityConfig": { "Authority": "http://myapp.azurewebsites.net" } 

When I deploy application I don't want to change Authority value each time into different environments. This section belongs to appsettings.json file in a ASP.NET CORE project.

1

1 Answer 1

7

When developing an ASP.NET Core app and using app settings or connection strings in App Service, you need to name your settings so that it corresponds to your settings structure.

So this setting for example should have:

So you take all of the keys in the hierarchy and join them with colons.

Classic ASP.NET apps make the settings/connection strings directly available on ConfigurationManager at runtime. If the names of settings/connection strings exactly match those in web.config, the values set in App Service override the values at runtime.

Other frameworks and languages would typically use the settings as environment variables.

Sign up to request clarification or add additional context in comments.

2 Comments

Just to be clear this is an ASP.NET Core specific implementation, other programming stacks simply read App Service app settings as environment variables (string verbatim, no hierarchy).
App Service config doesn't allow colons, so to make this work, change to double underscores, example: AppSetting:AppUrl -> AppSetting__AppUrl

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.