问题描述
有没有办法更改在 Consumption 计划下运行的 Azure Functions 当前的 5 分钟超时限制?
Is there a way to change the current 5 minutes timeout limit for Azure Functions running under the Consumption plan ?
对于某些数据分析计算,5 分钟是不够的.
For some data analytics computations 5 minutes is not enough time.
使用 webjobs 的替代方法不允许并行执行函数.
The alternative of using webjobs doesn't allow parallel execution of the function.
推荐答案
(其他答案有点混乱,所以写而不是编辑)
(Other answer is a bit confusing, so writing instead of editing a lot)
通过将 functionTimeout
设置添加到 host.json
文件,Azure Functions 现在可以使用消耗计划运行长达 10 分钟:
Azure Functions can now run up to 10 minutes using the consumption plan by adding the functionTimeout
setting to your host.json
file:
在无服务器消费计划中,有效范围为 1 秒到 10 分钟,默认值为 5 分钟.
在高级和专用(应用服务)计划中,没有总体限制,默认值为 30 分钟.-1 值表示无限执行,但建议保持固定上限
In both Premium and Dedicated (App Service) plans, there is no overall limit, and the default value is 30 minutes. A value of -1 indicates unbounded execution, but keeping a fixed upper bound is recommended
来源:https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout
文件:host.json
// Value indicating the timeout duration for all functions.
// Set functionTimeout to 10 minutes
{
"functionTimeout": "00:10:00"
}
来源:
https://buildazure.com/2017/08/17/azure-functions-extend-execution-timeout-past-5-minutes/
https://github.com/Azure/azure-webjobs-sdk-script/wiki/host.json
这篇关于消费计划的 Azure Functions 超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!