QueueTrigger retry policy with durable function

Peter Velthuis 1 Reputation point
2021-09-28T15:24:13.377+00:00

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
    2021-09-30T17:23:51.27+00:00

    @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.