0
votes

I am new to Azure development and developed a function app

I published my function app to Azure portal. It is working fine on my development machine but on portal it's throwing following exception (some times)
The operation 'ScanLogs' with id '2eggec6de-54f5-4t34-5423-afffce5c6a43' did not complete in '00:02:00'.

I couldn't find solution to this error. Can somebody help me to understand what this error is about and why we get this?
following is timeout specified in host.json in prod.
enter image description here

1
In short: the operation 'ScanLogs' is taking too much time. Is it waiting for resources? What's the code? Did you add logging? Please provide a minimal reproducible example. - rickvdbosch
this is a BlobTriggerred function app, we move files to storage account. I have no logs, but enables Application Insights for this purpose. - shary.sharath

1 Answers

0
votes

Depending on the version of function you are running check here for the exact syntax in host.json - https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json-v1

The default timeout for a function on the consumption plan is 2 minutes, if you need it to run longer then change/add the functiontimeout value, i.e.

"functionTimeout": "00:05:00",

in host.json.

NB: On a Consumption plan this can't be more than 10 minutes so if you need it to run longer either find a way to break up your function into smaller chunks and maybe use a Durable function fan=out fan-in pattern or change it to run on a dedicated App Service Plan where it can run for as long as you like but obviously you'll have to pay to have the server running 24/7