1

I've specified a timeout on my http trigger azure functions (v1) by specifying the following in my host.json file

{
  "functionTimeout": "00:10:00"
}

I've deployed to Azure using VS2017 and can confirm that this setting now appears in the Azure Portal. I also restarted the function app just to be sure.

When I execute my function, it is always timing out on or around 4 minutes, even though the timeout has been set to 10 minutes

I've ruled out the timeout occurring from other sources as when I test the Azure function locally it does not time out.

Can anyone shed some light on why this is happening?

Jerry Liu
  • 17,282
  • 4
  • 40
  • 61
link64
  • 1,944
  • 1
  • 26
  • 41

2 Answers2

5

It is expected. Http request has a fixed timeout setting on Azure site. See Azure Web App timeout setting of 230s. In this aspect, there's no difference between Azure Web app and Http trigger Azure Function.

There is a 230 second (i.e. a little less than 4 mins) timeout for requests that are not sending any data back. After that, the client gets the 500 you saw, even though in reality the request is allowed to continue server side.

As for how to bypass this limitation, if it's not necessary to get an immediate feedback like httpresponse, you can use queue trigger to do your job.

Otherwise, have a look at Durable function. You could send an http request to start an orchestrator and get a response that it starts successfully and so on. The work is being processed in orchestrator and activity function and we don't need to worry about time out(as they are non-http trigger as well).

Jerry Liu
  • 17,282
  • 4
  • 40
  • 61
0

Azure Functions team at Microsoft has added a configuration option that enables an Azure Functions App to have the timeout increased.

Full answer @Build5Nines.com Azure Functions: Extend Execution Timeout Past 5 Minutes

In short edit host.json and set functionTimeout:

// Set functionTimeout to 10 minutes
{
    "functionTimeout": "00:10:00"
}
adrianko
  • 229
  • 3
  • 6