Место общения программистов C#
Anonymous
Исключение TimeTrigger "не может создать BlobContainerClient для PradeLemonitor".
Сообщение
Anonymous » 24 сен 2025, 14:16
Когда я запускаю свою функцию Azure с TimeTrigger, у меня есть эта ошибка: < /p>
microsoft.azure.webjobs.extensions.timers.storage: не может создать blobcontainerclient для waredulemonitor. />
Код: Выделить всё
public static async Task Main()
{
var host = CreateHostBuilder().Build();
using (host)
{
await host.RunAsync();
}
static IHostBuilder CreateHostBuilder() => new HostBuilder()
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureFunctionsWorkerDefaults()
.ConfigureHostConfiguration(configHost =>
{
configHost.SetBasePath(Directory.GetCurrentDirectory());
configHost.AddJsonFile("host.json", optional: true);
configHost.AddEnvironmentVariables();
})
.ConfigureAppConfiguration((hostContext, configApp) =>
{
var env = hostContext.HostingEnvironment;
configApp.AddJsonFile("appsettings.json", optional: true);
configApp.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
configApp.AddEnvironmentVariables();
configApp.AddApplicationInsightsSettings(developerMode: !env.IsProduction());
})
.ConfigureServices((hostContext, services) =>
{
[...]
})
.ConfigureContainer(builder =>
{
builder.RegisterModule();
})
.ConfigureLogging((hostContext, configLogging) =>
{
if (hostContext.HostingEnvironment.IsDevelopment())
{
configLogging.AddConsole();
configLogging.AddDebug();
}
})
.UseConsoleLifetime();
< /code>
И вот функция: < /p>
[Function("QueueMessage")]
public async Task QueueMessageAsync(
[TimerTrigger("%MessageQueuerOccurence%", RunOnStartup = true)] TimerInfo timer
)
{
[...]
}
< /code>
csproj: < /p>
net6.0
v4
Exe
< /code>
local.settings.json:
написан{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"MessageQueuerOccurence": "0 */15 * * * *",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}
Что я пропустил?>
Подробнее здесь:
https://stackoverflow.com/questions/707 ... ulemonitor
1758712598
Anonymous
Когда я запускаю свою функцию Azure с TimeTrigger, у меня есть эта ошибка: < /p> microsoft.azure.webjobs.extensions.timers.storage: не может создать blobcontainerclient для waredulemonitor. /> [code]public static async Task Main() { var host = CreateHostBuilder().Build(); using (host) { await host.RunAsync(); } static IHostBuilder CreateHostBuilder() => new HostBuilder() .UseServiceProviderFactory(new AutofacServiceProviderFactory()) .ConfigureFunctionsWorkerDefaults() .ConfigureHostConfiguration(configHost => { configHost.SetBasePath(Directory.GetCurrentDirectory()); configHost.AddJsonFile("host.json", optional: true); configHost.AddEnvironmentVariables(); }) .ConfigureAppConfiguration((hostContext, configApp) => { var env = hostContext.HostingEnvironment; configApp.AddJsonFile("appsettings.json", optional: true); configApp.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); configApp.AddEnvironmentVariables(); configApp.AddApplicationInsightsSettings(developerMode: !env.IsProduction()); }) .ConfigureServices((hostContext, services) => { [...] }) .ConfigureContainer(builder => { builder.RegisterModule(); }) .ConfigureLogging((hostContext, configLogging) => { if (hostContext.HostingEnvironment.IsDevelopment()) { configLogging.AddConsole(); configLogging.AddDebug(); } }) .UseConsoleLifetime(); < /code> И вот функция: < /p> [Function("QueueMessage")] public async Task QueueMessageAsync( [TimerTrigger("%MessageQueuerOccurence%", RunOnStartup = true)] TimerInfo timer ) { [...] } < /code> csproj: < /p> net6.0 v4 Exe < /code> local.settings.json: написан{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "MessageQueuerOccurence": "0 */15 * * * *", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" } } [/code] Что я пропустил?> Подробнее здесь: [url]https://stackoverflow.com/questions/70764836/timetrigger-exception-could-not-create-blobcontainerclient-for-schedulemonitor[/url]