CodexBloom - Programming Q&A Platform

Azure Functions Timing Out When Triggered by Service Bus Queue - 'Execution Timeout' scenarios

πŸ‘€ Views: 549 πŸ’¬ Answers: 1 πŸ“… Created: 2025-08-20
azure-functions service-bus timeout C#

I keep running into I need some guidance on Does anyone know how to I'm upgrading from an older version and I have an Azure Function that is supposed to process messages from a Service Bus queue, but I'm working with an 'Execution Timeout' behavior. The function is set to run in a Consumption Plan, and the default timeout is 5 minutes. I've confirmed that the messages being sent to the queue are generally smaller than 1 KB, and the processing logic isn't overly complex, yet the function times out frequently when processing these messages. I've tried increasing the timeout by adding the `FUNCTIONS_WORKER_TIMEOUT` setting in the Application Settings of my function app, but it seems to have no effect. Here’s the code for the function: ```csharp [FunctionName("ProcessQueueMessage")] public static async Task Run([ServiceBusTrigger("myqueue", Connection = "ServiceBusConnectionString")] string myQueueItem, ILogger log) { log.LogInformation($"Processing message: {myQueueItem}"); // Simulate processing time await Task.Delay(300000); // Simulating work for 5 minutes } ``` I've also looked into the logs and found that the function is being triggered, but it doesn't seem to complete before the timeout. I’ve checked the Service Bus connection string and it’s correct. My function app is running in the West US region, with the following settings: - Azure Functions runtime: v3.0 - .NET version: 3.1 - Consumption Plan configuration: default settings What could be causing the timeout, and how can I resolve this scenario to ensure my function processes the messages without timing out? For context: I'm using C# on macOS. Has anyone dealt with something similar? This is for a microservice running on Ubuntu 22.04.