Search code examples
azureazure-web-app-serviceasp.net-core-2.1azure-app-service-envrmnt

Azure: How to reload the Environment Variables without rebooting the App Service


What I’m trying to achieve:
In an ASP.NET Core Web App, I want to listen for the configuration change event, and reload the new configuration value at run time. I'm changing the configuration setting by using the following CLI operation:

For Example:

az webapp config appsettings set --name $WebAppName --slot $SlotName --resource-group $ResourceGroupName --settings A_Setting_To_Monitor=$NewSettingValue

How can I detect this change event and load the new configuration value without resetting the App Service?

I'm using C# and .NET Core 2.1.

The Application Settings of Azure Web App Service


Solution

  • Have a look at Azure App Configuration.

    Azure App Configuration provides a service to centrally manage application settings. Modern programs, especially programs running in a cloud, generally have many components that are distributed in nature. Spreading configuration settings across these components can lead to hard-to-troubleshoot errors during an application deployment. Use App Configuration to store all the settings for your application and secure their accesses in one place.

    App Configuration makes it easier to implement the following scenarios:

    • Centralized management and distribution of hierarchical configuration data for different environments and geographies
    • Dynamic configuration changes without the need to redeploy or restart an application
    • Feature management