环境:.Net Framework 4.7.2
正在读取的应用程序设置:app.config,项目中没有 applicationsettings.json
问题:环境变量不会覆盖 project.exe.config(Kudu 中的一个)中的 CRON 表达式并触发。所有其他应用程序设置都被覆盖,但 CRON 表达式。
这是我的建设者:
var builder = new HostBuilder();
var resolver = new myNameResolver();
builder.ConfigureWebJobs(buil =>
{
buil.AddAzureStorageCoreServices();
buil.AddAzureStorage();
buil.AddServiceBus(servBus=>
{
servBus.MessageHandlerOptions.AutoComplete = false;
servBus.MessageHandlerOptions.MaxConcurrentCalls = myMaxConcurrentCalls;
servBus.ConnectionString = myServiceBusConnectionString;
servBus.MessageHandlerOptions.MaxAutoRenewDuration = TimeSpan.FromHours(12);
});
buil.AddTimers();
});
builder.ConfigureServices(serv => serv.AddSingleton<INameResolver>(resolver));
builder.ConfigureHostConfiguration(config =>
{
config.AddInMemoryCollection(BuildConfiguration(myStorageConnectionString));
config.AddEnvironmentVariables();
});
builder.ConfigureAppConfiguration(buil => buil.AddEnvironmentVariables());