[英]Azure Function Timeout after 30 minutes
I have set up an Azure Function v3.我已经设置了一个 Azure Function v3。 Configured with Standard plan per this document: https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout .
根据本文档配置标准计划: https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout 。 Also, set up functionTimeout to Unlimited
另外,将 functionTimeout 设置为 Unlimited
Is Standard (S1:1) plan the right one?标准(S1:1)计划是否合适? Do I need to change it to P1V12 in order to be able to set it to 'unlimited' timeout?
我是否需要将其更改为 P1V12 才能将其设置为“无限”超时?
Keeps crashing after 30 minutes: 30分钟后继续崩溃:
It's as if host.json is not being considered?好像没有考虑host.json? or is the plan not correct?
还是计划不正确? Please help.
请帮忙。
I was able to get this to work is to add an attribute:我能够让它工作是添加一个属性:
[Timeout("05:00:00")]
[FunctionName("MyFunction")]
Seems host.json file is being ignored似乎 host.json 文件被忽略
EDIT - Fix with HOST.JSON file编辑 -使用 HOST.JSON 文件修复
Found this thread: https://github.com/Azure/azure-functions-servicebus-extension/issues/81找到这个线程: https://github.com/Azure/azure-functions-servicebus-extension/issues/81
Solution: https://github.com/Azure/azure-functions-servicebus-extension/issues/34#issuecomment-596781972解决方案: https://github.com/Azure/azure-functions-servicebus-extension/issues/34#issuecomment-596781972
public override void Configure(IFunctionsHostBuilder builder)
{
var tempServices = builder.Services.BuildServiceProvider();
var azureFuncConfig = tempServices.GetService<IConfiguration>();
var configBuilder = new ConfigurationBuilder()
.AddConfiguration(azureFuncConfig)
.SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables();
var configReader = configBuilder.Build();
var config = configBuilder.AddAzureKeyVault(new AzureKeyVaultConfigurationOptions()
{
Client = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(new AzureServiceTokenProvider().KeyVaultTokenCallback)),
Vault = configReader["keyvaulturl"],
Manager = new DefaultKeyVaultSecretManager()),
}).Build();
builder.Services.AddSingleton<IConfiguration>(config);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.