CodexBloom - Programming Q&A Platform

Azure Function Timeout: How to Extend Default Timeout for Durable Functions in C#

πŸ‘€ Views: 16 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-12
azure-functions durable-functions csharp C#

I'm currently working with Azure Durable Functions in C# and I'm running into a timeout scenario. My orchestration function is supposed to handle a long-running process, but it keeps timing out after 5 minutes, which is the default timeout for Azure Functions. I understand that I can extend the timeout for durable functions, but I need to seem to get it to work correctly. Here’s a snippet of my orchestration function: ```csharp [FunctionName("LongRunningOrchestration")] public static async Task RunOrchestrator([OrchestrationTrigger] IDurableOrchestrationContext context) { var result = await context.CallActivityAsync<string>("LongRunningActivity", null); return result; } ``` And the activity function looks like this: ```csharp [FunctionName("LongRunningActivity")] public static async Task<string> RunActivity([ActivityTrigger] string name, ILogger log) { // Simulating long processing time await Task.Delay(TimeSpan.FromMinutes(10)); return "Finished"; } ``` I've added a `FunctionTimeout` in the host.json file to extend the timeout: ```json { "functionTimeout": "00:30:00" } ``` However, I still receive the following behavior message in the logs: ``` Function 'LongRunningOrchestration' failed: The function was running for too long and was terminated. ``` I've deployed this to an Azure Function App with the consumption plan. I’ve read that the consumption plan has certain limits, but I thought durable functions would handle this differently. Is there a specific configuration I’m missing, or is it a limitation of the consumption plan? Any help would be greatly appreciated!