Reputation: 8009
Is an ActivityTrigger Durable Function still restricted to max timeout duration of 10 mins via consumption plan below:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout
I came across the sample below, which seems to run over 10mins.
[FunctionName("A_SimulateLongRunningTask")]
public static async Task<object> TaskExecutor([ActivityTrigger] string taskInput, TraceWriter log)
{
dynamic longRunningTask = JsonConvert.DeserializeObject(taskInput);
//Simulate a long running task, based on the provided duration
//taskDurationInSeconds is 700 seconds, which is more than max of 10mins via consumption plan
await Task.Delay(TimeSpan.FromSeconds((int)longRunningTask.taskDurationInSeconds));
return true;
}
https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout
Upvotes: 4
Views: 2168
Reputation: 1811
It is a method of breaking up a long running task into multiple shorter running tasks and then linking them together so that each one call the next in the workflow once it completes. This essentially can free you up from the limited time constraints imposed by the Azure Functions Runtime that limits the maximum amount of time a Function can execute before it would be automatically killed off.
All these patterns must execute tasks that require custom code and they need to run in an asynchronous way, potentially for a long time, Azure Durable Functions is definitely the way to go. This blog post describes how we can implement a generic way of handling long-running tasks via Durable Functions, via the webhook action pattern.
Upvotes: -2