Azure function not running successfully.

Ananth Asamani 1 Reputation point
2021-01-29T08:46:51.2+00:00

Hi all,

I'm trying to run a azure function (1.x version) on azure cloud, and I'm getting the below error.

Microsoft.Azure.WebJobs.Host: Timeout value of 00:05:00 was exceeded by function: 'MY_FUNCTION_NAME.'

  • For the above error, I have raised the timeout value from default (5 min) to 10 min in the host.json file as below
  • { "functionTimeout": "00:10:00" }

[Error] The listener for function 'MY_FUNCTION_NAME.' was unable to start. mscorlib: One or more errors occurred. A task was canceled.

  • I'm unaware of how to handle the above error.

When I run it locally using visual studio 2017, it runs smoothly. I get the above listed 2 errors on Azure only.

I'm running the function on consumption plan, with 2 functions, 1 as timer trigger and the other as http trigger.
Http trigger function is running as expected.

One another question is, how to know if the timer trigger is fired at specified time, my CRON expression looks as "0 0 0 * * *"

I have literally eaten up almost a week as of today to resolve the issue. I highly appreciate if someone can help me in resolving my issue.

Thank you.

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

2 answers

Sort by: Most helpful
  1. Andriy Bilous 11,176 Reputation points MVP
    2021-01-29T11:49:08.52+00:00

    Hello @Ananth Asamani
    Here is a cheat sheet for Azure Function Cron Expresion
    https://arminreiter.com/2017/02/azure-functions-time-trigger-cron-cheat-sheet/

    Notice there are six placeholders; but in your scenario I see only four "0 0 0 *".

    You are correct Azure Function (1.x version) default timeout is 5 minutes and you can increase it to 10 minutes.
    https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout


  2. MayankBargali-MSFT 70,016 Reputation points
    2021-02-08T04:31:28.877+00:00

    Hi @Ananth Asamani

    As per the initial analysis, I can see below errors in the function app

    Issue 1: Function Site Name is over 32 Characters long.

    Recommendation:
    • Please modify the function site name to less than 32 characters.

    More Information: https://github.com/Azure/azure-functions-host/issues/2015

    Issue 2: The function app does not contain any active triggers.

    Recommendation:

    • Ensure to exclude comments in host.json. Comments are not valid in JSON, and you should exclude them in your actual host.json .

    • If you are finding your triggers has been configured properly, you might need to sync triggers manually. You can synchronize triggers with either of the following ways:

    • Go to Azure Portal and click the refresh button next to your Function App.
    • Make an API call to the sync triggers endpoint. Please refer to this Powershell sample.

    More Information:
    https://github.com/Azure/azure-functions-host/wiki/host.json
    https://github.com/Azure/azure-functions-host/issues/2474

    Once the trigger was active we see a timeout error and the recommendation is to navigate to App Service Diagnostics to configure appsettings correctly and then verify which piece of your code is taking more time to execute causing the timeout issue.

    0 comments No comments