简体   繁体   English

Azure Function 30 分钟后超时

[英]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 才能将其设置为“无限”超时?

在此处输入图像描述 在此处输入图像描述 host.json:主机.json:

在此处输入图像描述

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.

相关问题 azure function 检查 X 分钟后是否收到消息 - azure function check if message received after X minutes Azure Function 超时事件,原因 - Azure Function timeout event, reasons 测试时出现超时错误 Azure function app - Timeout errors when testing Azure function app Azure Function - 异常:OSError:[Errno 30] 只读文件系统: - Azure Function - Exception: OSError: [Errno 30] Read-only file system: 在 Twilio 和 Sendgrid api 中,计划消息以 5 小时 30 分钟的时间差发送 - Scheduled messages are sent at difference of 5 hours 30 minutes in Twilio and Sendgrid api SQL 服务器崩溃丢失30分钟数据正常吗? - Is it normal to lose 30 minutes of data on a SQL Server crash? Azure Function 几个小时后停止工作 - Azure Function Stops Working After a Few Hours Azure 隔离计时器触发器 Function 在部署到 Azure 后不起作用 - Azure Isolated Timer Trigger Function not working after deployment to Azure 为什么 firestore 在云 function 成功完成后几分钟更新文档? - why firestore updates the document few minutes after successful cloud function completion? Azure function 只是将记录插入雪花表工作正常但有时由于超时问题而失败 - Azure function which just inserts a record into a snowflake table is working fine but failing because of timeout issue sometime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM