azureazure-web-app-serviceazure-configuration

Azure App Service Application settings


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.


Solution

  • 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.