Azure function issue: Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule:

Anonymous
2024-04-09T11:27:29.4933333+00:00

0

We have an Azure Function app with 3 functions, one of which includes a timer trigger. Although it is originally scheduled to run every 4 hours, it is unexpectedly triggering every 2 to 3 minutes due to the "UnscheduledInvocationReason: IsPastDue." Additionally, this function makes multiple external API calls to pull data into the system, some of which succeed while others fail with a status of "Faulted."

We have attempted to disable, enable, restart, delete, and redeploy the function, but the issue still persists.

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2024-04-10T05:17:11.0566667+00:00

    @Praveen Thanks for reaching out.

    As per the error it indicates that the function was not triggered at the scheduled time. The function was scheduled to run at a specific time, but it did not run at that time. Instead, it ran later, and the reason for the delay was that the function was past due.

    "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.

    Can you please confirm if your timer trigger function is still running?

    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.