Azure function timeout
Asked Answered
F

2

5

Planning to provision 'Queue triggered' based Azure function on Azure on consumption pricing model. On every invocation of this function it may be expected to run randomly anywhere between 1 min to 30 mins or even longer/shorter, it depends. Occasional max. running time can be around 45 mins other wise most of the max. running time can be within 10 mins.

Is there timeout for 'Queue triggered' based Azure function? If yes, what is the max. timeout?

Is there any Azure function related based practices to overcome the timeout limitation?

(or)

Can 'Durable function' can be considered as an alternative to over come the max. timeout period limitation?

(or)

Is there any other better server-less component available on Azure for availing?

Fay answered 31/1, 2020 at 14:46 Comment(0)
D
7

Create a file called hosts.json in the root folder of the Azure Functions project, then add this to that file (source):

{
    "functionTimeout": "00:60:00"
}

You would need to upgrade to the Premium plan to have a maximum timeout of more than 10 minutes.

Delorsedelos answered 29/8, 2022 at 5:50 Comment(1)
Good response except "00:60:00" would be 1 hour so "01:00:00". I just ran mine with "00:59:00" locally and it workedTenner
H
2

You can use regular App Service Plan, instead of a consumption plan to remove the timeout limit of 10 minutes forced on you on the cunsumption plan. The default is 5 minutes for consumption plan.

Indicates the timeout duration for all functions. It follows the timespan string format. In a serverless Consumption plan, the valid range is from 1 second to 10 minutes, and the default value is 5 minutes.

In the Premium plan, the valid range is from 1 second to 60 minutes, and the default value is 30 minutes.

In a Dedicated (App Service) plan, there is no overall limit, and the default value is 30 minutes. A value of -1 indicates unbounded execution, but keeping a fixed upper bound is recommended

https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout

Heterosexual answered 31/1, 2020 at 18:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.