【Azure Function】在Function执行中遇见Timeout错误

简介: 【Azure Function】在Function执行中遇见Timeout错误

问题描述

在Function执行中遇见Timeout错误: Microsoft.Azure.WebJobs.Host.FunctionTimeoutException

/Timeout value of 00:30:00 was exceeded by function

/Functions.TimerTrigger_UdeskContact    

async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryHandleTimeoutAsync(Task invokeTask,CancellationToken shutdownToken,Boolean throwOnTimeout,CancellationToken timeoutToken,TimeSpan timeoutInterval,IFunctionInstance instance,Action onTimeout)

D:\a\_work\1\s\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs

 

有什么办法可以缓解执行时间过长的问题吗?

 

问题解答

在Function的设计中,有一个参数可以设置Funciton的执行时间,参数名为 functionTimeout ,配置在Function的 host.json 文件中。

指示所有函数执行的超时持续时间。它遵循时间跨度字符串格式。

所以除了可以修改functionTimeout的值之外,对于长时间执行的Function,更推荐使用持久函数(Durable Functions: https://docs.azure.cn/zh-cn/azure-functions/durable/durable-functions-types-features-overview

 

参考资料:

functionTimeout in host.json : https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout

 

相关文章
|
24天前
|
JavaScript Linux 数据中心
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
|
24天前
|
Java 容器
【Azure Function App】Java Function在运行中遇见内存不足的错误
【Azure Function App】Java Function在运行中遇见内存不足的错误
|
24天前
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
|
24天前
[Azure Developer]把Azure Function中ILogger对象静态化为静态方法提供日志记录
[Azure Developer]把Azure Function中ILogger对象静态化为静态方法提供日志记录
|
24天前
【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析
【Azure Function App】本地运行的Function发布到Azure上无法运行的错误分析
|
24天前
【Azure Function App】遇见无法加载Microsoft.Azure.WebJobs.ParameterBindingData的问题
【Azure Function App】遇见无法加载Microsoft.Azure.WebJobs.ParameterBindingData的问题
|
24天前
【Azure Function】Azure Function中的Timer Trigger无法自动触发问题
【Azure Function】Azure Function中的Timer Trigger无法自动触发问题
|
24天前
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
|
24天前
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
24天前
|
API
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)
【Azure Function】Function本地调试时遇见跨域问题(blocked by CORS policy)

热门文章

最新文章