【Azure 应用服务】Azure Function在执行Function的时候,如果失败了,是否可以重试呢?

简介: 【Azure 应用服务】Azure Function在执行Function的时候,如果失败了,是否可以重试呢?

问题描述

Azure Function在执行Function的时候,如果失败了,是否可以重试呢?

 

问题解答

Function app默认是不开启重试的,但是可以修改 host.json 文件来定义重试策略(retry),具体内容如下:

{
    "retry": {
        "strategy": "fixedDelay",            //使用的重试策略
        "maxRetryCount": 2,   //最大重试次数
        "delayInterval": "00:00:03"  //在重试之间的延迟
    }
}

 

参考资料

Azure Functions 2.x 及更高版本的 host.json 参考: https://docs.azure.cn/zh-cn/azure-functions/functions-host-json#retry

Azure Functions 错误处理和重试: https://docs.azure.cn/zh-cn/azure-functions/functions-bindings-error-pages?tabs=csharp#retry-policies-preview

 

相关文章
|
2月前
【Azure Function】Azure Function中的Timer Trigger无法自动触发问题
【Azure Function】Azure Function中的Timer Trigger无法自动触发问题
|
2月前
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
|
2月前
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
2月前
|
Python
【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表
【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表
|
2月前
|
C#
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?
【Azure Function】Function App启动时出现 Failed to open local port 4001 错误,这是什么情况呢?
|
2月前
|
C# C++
【Azure Function】在VS Code中创建Function项目遇见 No .NET worker runtimes found
【Azure Function】在VS Code中创建Function项目遇见 No .NET worker runtimes found
|
2月前
【Azure Function & Application Insights】调用Function上传和下载文件,有时候遇见大于1MB的文件的日志没有记录在Application Insights中
【Azure Function & Application Insights】调用Function上传和下载文件,有时候遇见大于1MB的文件的日志没有记录在Application Insights中
|
2月前
|
API C++ Python
【Azure Function】示例运行 python durable function(model V2)
【Azure Function】示例运行 python durable function(model V2)
|
2月前
|
C++
【Azure Function App】在VS Code中,创建好Function App后部署到Azure中,无法选择Subscriptions
【Azure Function App】在VS Code中,创建好Function App后部署到Azure中,无法选择Subscriptions
|
2月前
|
安全 Oracle Java
【Azure Function】Azure Function中使用 Java 8 的安全性问题
【Azure Function】Azure Function中使用 Java 8 的安全性问题

热门文章

最新文章

下一篇
无影云桌面