Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Infinite Timeout for Azure Function app v2.0

I have a very long running process which is hosted using Azure Function App (though it's not recommended for long running processes) targeting v2.0. Earlier it was targeting v1.0 runtime so I didn't face any function timeout issue.

But now after updating the runtime to target v2.0, I am not able to find any way to set the function timeout to Infinite as it was in case of v1.0.

Can someone please help me out on this ?

like image 331
shyam_baidya Avatar asked Oct 23 '18 16:10

shyam_baidya


People also ask

How do I increase the timeout value on an Azure function?

Locate the host. json file underneath the WWWROOT folder / directory within the App. By default this file will be empty. You can then add the functionTimeout property and set it to your desired timeout threshold, such as 10 minutes (00:10:00).

Do Azure functions have a time limit?

Azure Functions in a Consumption plan are limited to 10 minutes for a single execution. In the Premium plan, the run duration defaults to 30 minutes to prevent runaway executions. However, you can modify the host. json configuration to make the duration unbounded for Premium plan apps.

What is default time out for Azure function?

Regardless of the function app timeout setting, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the default idle timeout of Azure Load Balancer.

How long can Azure durable functions run?

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.


1 Answers

From your comments it looks like breaking up into smaller functions or using something other than functions isn't an option for you currently. In such case, AFAIK you can still do it with v2.0 as long as you're ready to use "App Service Plan".

The max limit of 10 minutes only applies to "Consumption Plan".

enter image description here

In fact, documentation explicitly suggests that if you have functions that run continuously or near continuously then App Service Plan can be more cost-effective as well.

You can use the "Always On" setting. Read about it on Microsoft Docs here.

Azure Functions scale and hosting

enter image description here

Also, documentation clearly states that default value for timeout with App Service plan is 30 minutes, but it can be set to unlimited manually.

Changes in features and functionality

enter image description here

UPDATE

From our discussion in comments, as null value isn't working for you like it did in version 1.x, please try taking out the "functionTimeout" setting completely.

I came across 2 different SO posts mentioning something similar and the Microsoft documentation text also says there is no real limit. Here are the links to SO posts I came across:

  • SO Post 1
  • SO Post 2
like image 200
Rohit Saigal Avatar answered Sep 23 '22 19:09

Rohit Saigal