ASP.NET Core environment variables reload configuration on change

Viewed 308

When using standard appsettings configuration for your ASP.NET Core application there is an option to reload configs on file change by specifying reloadOnChange parameter:

    var builder = new ConfigurationBuilder()
        .SetBasePath(environment.ContentRootPath)
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
        .AddEnvironmentVariables();

When calling AddEnvironmentVariables() it allows you to use environment variables as well for generating your config. So the question is if there is a way to set reload on change for environment variables? So my application config is getting reset on environment variable change

0 Answers
Related