Код: Выделить всё
var options = new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
#if DEBUG
.AddJsonFile("local.settings.json")
#else
.AddJsonFile("appsettings(pass the env name).json")
#endif
.Build();
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
})
.Build();
host.Run();
Подробнее здесь: https://stackoverflow.com/questions/788 ... e-in-net-8