Timer triggered consumption function with NCRON expression in app settings not executing on-time.

Sergey Nosov 21 Reputation points
2021-07-24T04:51:59.927+00:00

Please help diagnosing the following past due execution. Thank you.

Are you using Consumption or App Service Plan:
Consumption

If Consumption, how did you deploy?
Azure DevOps Release pipeline (Function App on Windows task)

Are you using the v1 runtime, or the v2 (Preview) runtime?
dotnet worker runtime extension version 3

Are you setting WEBSITE_TIME_ZONE?
Yes: Eastern Standard Time

What is your CRON expression set to, and what is your expectation about what it means.
** 0 0 21 * * * (in application settings)
I expect it to fire every day at 9 PM **

Give a specific UTC time at which you expected your function to get called, and found that it wasn't. Also, explain how you are determining that it is not getting called.

1 AM UTC
The function app did not wake up at all until I started interacting with it in the portal.
Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2021-07-23T21:00:00.0000000-04:00

include a sample invocation ID so we can find your app and look into the issue
Executing 'allocate-csrs-scheduled' (Reason='Timer fired at 2021-07-23T23:44:32.4963403-04:00', Id=39a84255-5b08-4203-9da2-9a1991e1c490)

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2021-07-26T10:23:55.543+00:00

    Hi @Sergey Nosov

    Welcome to Microsoft Q&A! Thanks for posting the question.

    As per the code "UnscheduledInvocationReason" occurs when either "RunOnStartup" or "isPastDue" is set to true. Now as per the document here , "isPastDue" property is set to true when the current function invocation is later than scheduled, for example this can happen if a function was restarted. You can find the logical implementation here in the code. You can set "UseMonitor = false" to disable "UnscheduledInvocationReason" due to "isPastDue".

    TimerTrigger uses the Singleton feature of WebJobs SDK to ensure that a single instance of a function app is running by acquiring a Blob lease, the log you are observing here is regarding this singleton behavior. Please refer to this document here for more information.

    Feel free to get back to me if you have any queries or concerns.

    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.