QueueTrigger retry policy with durable function

Peter Velthuis 1 Reputation point

Is it possible to use the default queue trigger retry policy (think it's five retries) when you kick off an orchestration using StartNewAsync ?
So the queue trigger function would just have one line of code: starter.StartNewAsync(..).

The issue is that startNewAsync returns when the orchestration has started, so underlying exceptions won't bubble back up to the trigger.
I know there are alternatives like starting an orchestration and have it in turn use CallSubOrchestratorWithRetryAsync with a custom retry, but it's hard to get the current retry number with that.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,653 questions
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
100 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,611 Reputation points Microsoft Employee

    @Peter Velthuis While a direct retry isn't possible, you could poll the status using the GetStatusAsync API and retry in code on failure. But with something like this, you need to ensure that everything runs within the function timeout otherwise the queue triggered function would just always fail.

    Instead, another option would be to have your orchestrator send a failure queue message that triggers the retry while keeping count and logging exceptions.