I have Azure Function using .NET Core 3.1\C# I am trying to use retry policy. See below code for the function:
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
namespace DevFunctionApp
{
public class Function1
{
private static int _counter = 0;
public Function1() { }
[FunctionName("Function1")]
[FixedDelayRetry(5, "00:01:00")] // delayInterval = 1 minute
public void Run([TimerTrigger("0 */10 * * * *")] TimerInfo myTimer, ILogger log) // it runs every 10 minutes
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
throw new System.Exception("Azure Function Rety Exception");
}
}
}
When Function fails retry logic works correctly for the first, second and third retry but for last two fourth and fifth it fires them at the same time. See log below:
Doesn't matter how many retries or time interval set it always fires last two retries at the same time.
Question: How to fix the issue of last two retries firing at the same time?