Select Language:
If you’re using a Flex Consumption plan with Azure Functions, you might notice that your functions are ending earlier than expected, around 3 to 4 minutes even though the documentation says they should run longer. Here’s how to troubleshoot and fix this issue.
First, it’s important to understand the default and maximum execution time settings. By default, functions can run for up to 30 minutes. If you want your functions to run longer, you can set the functionTimeout value in the host.json file, and it can go up to an unlimited duration. For example, setting it to 00:40:00 allows functions to run for up to 40 minutes.
However, if your function stops after just 3 or 4 minutes, this isn’t normal behavior based on the documented limits. You should verify that your application is on a Flex Consumption plan — not a regular Consumption plan. Also, confirm that the functionTimeout setting is correctly configured in the host.json file at the root of your project.
Next, check your logs, especially Application Insights, for any errors that happen around the 3-4 minute mark. Look for host or worker process errors that could cause the function to terminate early.
It’s also good to know that a 230-second (about 3.8 minutes) timeout applies only to HTTP-triggered functions because of Azure’s Load Balancer idle timeout. Timer-triggered functions are not affected by this limit, so the early termination isn’t due to this.
If everything looks correct — the plan type is right, the timeout settings are correct, and logs don’t show any errors — then this issue might be due to a problem with the platform itself. In that case, it’s best to contact Azure Support and reference this behavior, mentioning the expected timeout duration specified in the documentation.
By following these steps, you can determine whether the problem is with your setup or if it’s an underlying platform issue. Support can help resolve problems that aren’t caused by your configuration.




