You are seeing this behavior because you are throwing exception in the code. Please throw the exception in the catch block so that you dont encounter the retries.
[FunctionName("FixedDelayRetryTest")]
[FixedDelayRetry(5, "00:01:00")]
public void Run(
[ServiceBusTrigger("Topic", "Subscription", Connection = "ServiceBusConnString")] string item,
ExecutionContext context,
ILogger log
)
{
try
{
log.LogInformation($"Function executed at: {DateTime.Now}");
}
catch
{
throw new System.Exception("Error Happened!!");
}
}
如果答案有帮助,请点击“接受答案”并点赞。 注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知。