Ron Pitts Thanks for reaching out. Yes, the timeout limit of 5 applies to Durable Functions as well. By default, the maximum duration of a single function execution in Azure Functions is 10 minutes. This includes Durable Functions. The same is documented here.
By default, functions running in the Consumption plan have a timeout of five minutes. If this limit is exceeded, the Azure Functions host is recycled to stop all execution and prevent a runaway billing situation. The function timeout is configurable.
If you need to run a long-running operation in a Durable Function, you can use the DurableOrchestrationContext.CreateTimer
method to create a timer that wakes up the function after a specified amount of time. However, the maximum duration of the timer is also limited to 6 days.
Here's an example of how you can use the DurableOrchestrationContext.CreateTimer
method to create a timer that wakes up the function after 5 hours:
[FunctionName("MyOrchestratorFunction")]
public static async Task RunOrchestrator(
[OrchestrationTrigger] DurableOrchestrationContext context)
{
// Create a timer that wakes up the function after 5 hours
DateTime wakeUpTime = context.CurrentUtcDateTime.AddHours(5);
await context.CreateTimer(wakeUpTime, CancellationToken.None);
// Perform the long-running operation here
// ...
}
In this example, the DurableOrchestrationContext.CreateTimer
method is used to create a timer that wakes up the function after 5 hours. The AddHours
method of the DateTime
object is used to calculate the wake-up time.
The same is documented here. Please review the timer limitation here.
Feel free to get back to me if you have any queries or concerns.
Please "Accept Answer" if the answer is helpful so that it can help others in the community.