我尝试了两种方法来限制“失败”函数的重试次数,但都不起作用(如下所述)。我的发展面临挑战,因此任何和所有的帮助都将不胜感激
上下文:在将电子邮件附件保存到blob后,该功能被放置在一个由电子邮件触发的逻辑应用程序中。保存文件后,函数将成功执行,但逻辑应用程序在运行2-3分钟后返回“BadRequest.Http请求失败:服务器未在超时限制内响应”。然后,逻辑应用程序再重试该函数4次
方法1:我将retry放在host.json中:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
},
"retry": {
"strategy": "fixedDelay",
"maxRetryCount": 0,
"delayInterval": "00:00:05"
}
}
方法2:我将相同的代码片段放入function.json中:
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
],
"retry": {
"strategy": "fixedDelay",
"maxRetryCount": 0,
"delayInterval": "00:00:10"
}
}
重试策略由
azure logic app
定义,您不应该在函数中配置它,而应该在azure logic app actions中配置重试策略。您可以参考Retry policies:如果要将重试次数配置为0,请执行以下步骤
您可以单击
Http
操作右上角的···
,然后单击Settings
,然后选择Retry Policy
下的None
:相关问题 更多 >
编程相关推荐