Set Azure functions timeout in days or more than 24 hours.
Issue:
·
How
to set functions timeout in days or more than 24 hours?
Solution:
Azure functions
have various timeout values which depend on hosting plan e.g. default timeout
value in consumption plan is 5 min which can be further increased to 10 min via
updating functionTimeout property in host.json file.
You can get
complete list here,
Azure App Services and Function App: Azure Functions timeout
and
https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout
But if you
check it carefully, it allows you to define time in hh:mm:ss format where
H-hours, m-minutes and s- seconds.
Now you can say
I can define it like 25:00:00 which is more than 24 hours but it is invalid
format and you may get function runtime error. The range for hh is 00 to 23.
Then how to solve
this problem.
And life savor
is https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings#the-constant-c-format-specifier
For 2 days you
can define it like 2:00:00:00 where 2 is the optional and it is the number of
days, with no leading zeros
Problem solved.
Enjoy.
No comments:
Post a Comment