Azure function not triggering at all, despite 24 hour timertrigger schedule

Paul Riordan 0 Reputation points
2023-10-06T23:48:30.9666667+00:00

It's been a week since I last deployed, and the function has not triggered
CRON expression is set to [TimerTrigger("0 0 0 * * *")], like this:

`public static async Task Run([TimerTrigger("0 0 0 * * *")] TimerInfo myTimer, ILogger logger)`

However, when the schedule set to 'every 15 minutes', it correctly triggered every 15 minutes

I can see the 24 hour trigger is not being executed by checking the 'monitor' logs in the function portal, and from checking an event grid topic (my function triggers an event to this topic). These correctly show logs when the 'every 15 minutes' version is active

I'm using the following cli command to deploy:

`az functionapp deployment source config-zip -g <resourcegroup> -n <functionname> --src /[PATH]/Archive.zip`

Since I'm using a Consumption plan, I understand 'Always On' option is not available. I have tried restarted my function app to sync the trigger

Function runtime version: 4.25.2.21138

WEBSITE_TIME_ZONE is not set (no specific time required)

Re WEBSITE_RUN_FROM_PACKAGE; I created two function apps, one with this option set to 1, neither are triggered

Sample invocation Id = 4820f15a-11a5-4b92-8fe6-9fa6cc8c2803

Time = 2023-09-30T22:00:00.0128422+00:00'

Region = UK South

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-10-10T06:02:17.24+00:00

    @Paul Riordan Thanks for reaching out.

    As you have set the CRON expression to 0 0 0 * * * which means that the function should trigger every day at midnight UTC. However, you mentioned that it has not been triggered for a week.

    Can you please confirm if you don't see any other invocation for the last week as one of the possible reason for this could be that the timezone of your function app is not set to UTC. By default, the CRON expression runs based on Coordinated Universal Time (UTC). If you want to run the CRON expression based on another timezone, you can create an app setting for your function app named WEBSITE_TIME_ZONE.

    You mentioned that you are using a Consumption plan, which means that the "Always On" option is not available. However, you can try restarting your function app to sync the trigger and if this doesn't work then you can try sync the trigger. For more details you can refer to the previous discussion here.

    The other reason would be if the storage account is deleted/key changed or your are using multiple function app sharing the same storage account. For more details, please refer to this.

    If the above doesn't work, then you can review the diagnosis and solve problem blade on your function app to know more details why the trigger was not triggered and the action plan if any to mitigate the issue.

    Please "Accept Answer" if the answer is helpful so that it can help others in the community.

    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.