Timeout in Function App hosted in App Service plan

Majid N | BIMAGE 0 Reputation points
2024-04-01T09:16:33.2666667+00:00

My Azure time_triggered function app which is hosted in app service plan shows following error:

Timeout value of 00:05:00 exceeded by function 'Functions.TimerTrigger1' (Id: 'acd62752-5c30-4ba9-8ee6-f21eb7bf11f6'). Initiating cancellation.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,200 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Andreas Baumgarten 111.9K Reputation points MVP
    2024-04-01T09:30:14.4166667+00:00

    Hi @Majid N | BIMAGE ,

    by default the timeout of a function in a consumption plan is 5 minutes and can be increased to 10 minutes at the maximum:

    Function app timeout duration

    To increase the timeout you can edit the "functionTimeout" value in the host.json: Sample host.json file


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


  2. TP 100.2K Reputation points
    2024-04-01T09:35:35.1866667+00:00

    Hi,

    Please confirm that you have set functionTimeout to higher value in your function app's host.json file. Additionally, please make sure Always on is set to On in your Function App -- Configuration blade -- General settings tab.

    For example, you might set functionTimeout to 30 minutes in your host.json file, snippet below:

    {
        "functionTimeout": "00:30:00" 
    }
    
    

    host.json reference - functionTimeout

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

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


  3. Pinaki Ghatak 5,305 Reputation points Microsoft Employee
    2024-05-10T20:01:51.8366667+00:00

    Hello @Majid N | BIMAGE

    This error message indicates that the function Functions.TimerTrigger1 has exceeded the timeout value of 5 minutes. The timeout duration for functions in a function app is defined by the functionTimeout property in the host.json project file. This property applies specifically to function executions.

    After the trigger starts function execution, the function needs to return/respond within the timeout duration. To resolve this issue, you can increase the timeout duration for your function app by updating the functionTimeout property in the host.json file.

    You can set the value to a higher value than the current value of 5 minutes. Here is an example of how to set the functionTimeout property to 10 minutes in the host.json file:

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

    After updating the host.json file, you need to redeploy your function app for the changes to take effect.

    I hope this helps


    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.