Tany
Tany

Reputation: 1322

How do I define retry count and interval for Azure function?

I have a blob triggered Azure function. I would like to define the retry policy (count and interval) for the function to be retried if it throws an exception. Is there a way I can do that ?

Upvotes: 2

Views: 9992

Answers (1)

mathewc
mathewc

Reputation: 13558

You can control the maximum number of retries via the maxDequeueCount setting in the "queues" config section of host.json (see here). The reason "queues" config affects blob functions is because behind the scenes a control queue is used for dispatching blobs to your functions. So the settings you configure for "queues" will affect the blob triggered functions as well. E.g. the default retry count is 5 - if a blob fails processing more than that, then it is moved to the poison queue.

You can control the time between retries via the visibilityTimeout setting.

Note that these settings are host wide and apply to all functions. You can't control these per function currently.

Upvotes: 5

Related Questions