Reputation: 4124
I would like to disable automatic retry in the Azure Durable Function. So whenever there is an error just stop executing and do not retry it again.
I updated host.json with the following settings but it seems not working.
{
"version": "2.0",
"retry": {
"strategy": "fixedDelay",
"maxRetryCount": 0,
"delayInterval": "00:00:00"
},
"extensions": {
"queues": {
"maxDequeueCount": 0
}
},
"functionTimeout": "00:30:00",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
I still can see queue messages in mystorageaccountname-workitems queue.
Upvotes: 0
Views: 1425
Reputation: 2440
Disable automatic retry for Azure Durable Function
To disable retry option in your durable function, add a function
[FunctionName("TimerOrchestratorWithRetry")]
public static async Task Run([OrchestrationTrigger] IDurableOrchestrationContext context)
{
var retryOptions = new RetryOptions(
firstRetryInterval: TimeSpan.FromSeconds(5),
maxNumberOfAttempts: 3);
await context.CallActivityWithRetryAsync("FlakyFunction", retryOptions, null);
// ...
}
Options to customize Automatic retry policy:
Upvotes: 1