Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

huangapple go评论102阅读模式
英文:

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

问题

I'm stumped here. I have an Azure Function with Python runtime, Consumption Plan, Timer Trigger.

Every time the Function runs it times out at 5 minutes even though the host.json is set for 10 minutes.

host.json:

{
  "version": "2.0",
  "functionTimeout": "00:10:00"
}

Error:

Exception type: Microsoft.Azure.WebJobs.Host.FunctionTimeoutException
Exception message: Timeout value of 00:05:00 was exceeded by function: Functions.daily_job

What am I missing here? Why is this occurring and how do I override it?


EDIT 1: functionTimeout is definitely set in Azure.

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

Yet it always throws a timeout error:

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`


EDIT 2:

I had two host.json files, one in the project root (the correct one, but one I was not editing!), and one in the function directory (the incorrect one I was editing). I removed the incorrect one and edited the correct file, and of course, the timeout is working as intended.

英文:

I'm stumped here. I have an Azure Function with Python runtime, Consumption Plan, Timer Trigger.

Every time the Function runs it timesout at 5mins even though the host.json is set for 10mins.

host.json:

{
  "version": "2.0",
  "functionTimeout": "00:10:00"
}

Error:

Exception type	Microsoft.Azure.WebJobs.Host.FunctionTimeoutException
Exception message	Timeout value of 00:05:00 was exceeded by function: Functions.daily_job

What am I missing here? Why is this occurring and how do I override it?


EDIT 1: functionTimeout is definitely set in Azure.

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

Yet it always throws a timeout error:

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`


EDIT 2:

I had two host.json files, one in the project root (the correct one, but one I was not editing!), and one in the function directory (the incorrect one I was editing). I removed the incorrect one and edited the correct file and of course, the timeout is working as intended.

答案1

得分: 1

如@AnandSowmithiran所说,重新检查或重新部署Azure函数应用程序,以确保host.json中的值在Azure Portal函数应用程序中完美部署。

您已正确写入host.json中的**functionTimeout**属性值,并在本地环境中成功运行。

您需要检查host.json中的相同值是否已发布到Azure Portal函数应用程序,方法是转到Azure门户 > 您的函数应用 > 应用程序文件:

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

正如在Azure Functions的规模限制MS Doc中所提到的,消耗计划的最大超时时间为10分钟,这看起来是正确的,并且在Azure Portal函数应用程序中也应该如上所示。

英文:

As @AnandSowmithiran Said, recheck or redeploy the Azure Function App in order to make host.json values deployed perfectly in Azure Portal Function App.

You have written the functionTimeout attribute value correctly in host.json and working successfully in the local environment.

And you have to check the same Values of host.json are published or not in the Azure Portal Function App by going to Azure portal > Your Function App > App Files:

Azure Function timeout after 5mins even though `functionTimeout` is set to `00:10:00` in `host.json`

As mentioned in the Scale limits of Azure Functions MS Doc, 10 minutes is the maximum time out for consumption plan which looks fine and same should be present in Azure Portal Function App as shown in the above.

huangapple
  • 本文由 发表于 2023年3月7日 12:30:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75658054.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定