消费计划的 Azure 函数超时

标签 azure azure-functions

我通过在 host.json 文件中指定以下内容,在我的 http 触发器 azure 函数 (v1) 上指定了超时

{
  "functionTimeout": "00:10:00"
}

我已使用 VS2017 部署到 Azure,并且可以确认此设置现在显示在 Azure 门户中。为了确定起见,我还重新启动了函数应用程序。

当我执行函数时,即使超时已设置为 10 分钟,它总是会在 4 分钟左右超时

我已经排除了其他来源发生的超时,因为当我在本地测试 Azure 函数时,它不会超时。

谁能解释一下为什么会发生这种情况?

最佳答案

这是预料之中的。 Azure 站点上的 HTTP 请求有固定的超时设置。请参阅Azure Web App timeout setting of 230s 。在这方面,Azure Web 应用程序和 Http 触发器 Azure Function 没有区别。

There is a 230 second (i.e. a little less than 4 mins) timeout for requests that are not sending any data back. After that, the client gets the 500 you saw, even though in reality the request is allowed to continue server side.

至于如何绕过这个限制,如果不需要像httpresponse那样立即得到反馈,可以使用 queue trigger做好你的工作。

否则,请查看Durable function 。您可以发送 http 请求来启动协调器并获取启动成功的响应等等。工作正在协调器和事件函数中处理,我们不需要担心超时(因为它们也是非 http 触发器)。

关于消费计划的 Azure 函数超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53824034/

相关文章:

json - 在 Azure Function 中动态设置计划

amazon-web-services - 需要从 AWS Devops 服务连接 Azure 基础设施。这真的可能吗?

azure - ARM 模板错误 在请求中发现错误的 JSON 内容

python - 如何在本地镜像上应用 Azure OCR API 和 Request 库?

node.js - 在 Azure 函数(Nodejs)中使用 Jest 进行测试时 process.env 变量未定义

azure - 如何确保队列消息已在 Azure Functions 中成功处理?

具有 Azure 服务总线触发器的 Azure 函数 - 服务总线指标

适用于 Azure Databricks 的 Azure DevOps 管道

azure - 如何自动将 AKS 日志上传到 Azure 存储帐户

azure-devops - 使用 azure devops 部署的 Azure 函数仍使用旧代码