0

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.

1 Answer 1

1

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:

  • Max number of attempts: The maximum number of attempts. If set to 1, there will be no retry.
  • First retry interval: The amount of time to wait before the first retry attempt. for further reference check Automatic Retry Policy docs for durable functions.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.