Timer Trigger doesn't start because UnscheduledInvocationReason
In my Azure Functions I have 26 functions and only 7 with the timer trigger. There is no recommendation for Microsoft about it. Some functions have a timer trigger and at the end of the process each function sends an email. I have 2 type of timer trigger:
- run a function every 20 minutes
- run a function once at a particular time in the night
- Every 20 minutes the function is doing what I expect. Great.
The problem I'm facing is with the function that they have to start at a particular time. Basically, they don't start until I open the portal and do something on the Azure Function (for example open the monitor for one of them).
In the code point of view, all functions with the timer trigger are defined like that:
[FunctionName("invoiceMonthlyGeneratorTimer")]
public void Run([TimerTrigger("%Timers:GenerateMonthlyInvoices%")] TimerInfo myTimer)
{
// ..
}
[FunctionName("invoiceDunningTimer")]
public async Task Run([TimerTrigger("%Timers:DunningTimer%")] TimerInfo timer)
{
// ...
}
The configuration of the timer is in the settings file like:
"Timers": {
"DunningTimer": "0 0 4 * * *",
"GenerateMonthlyInvoices": "0 0 4 * * *"
}
Generally, speaking, this approach was working in dev environment and it is working perfectly in the production environment.
Because each function sends an email, I expect each morning to find in my inbox some emails but it doesn't happen. Then, I open the Azure portal to see the logs and the monitor.
Open the Azure function in the portal.

Open the monitor for a function

Whala, after a couple of seconds, I start to receive the email for all services! In the production environment I don't have all the function I have in dev because I want to test before deploying. In prod the functions are working fine and start at the right time.
If I look at Application Insights, I can find only the logs for the time I opened the monitor.

There is one interesting thing in the log:
Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2020-07-24T05:00:00.0000000+00:00

This error is consistent and I find it every day.
Hi, I notice simillar issue. In my case we have only two functions one with queue trigger and second with timer trigger

It works fine for sometime then time trigger stops to trigger for some time (it could be whole night or more)

Azure function is in consumption plan. This happens on all enviroments that we use
Hi any fixes to this even I am now facing the same issue
Hi @erossini, Apologies for the delayed response, Were you able to find a solution. If you still having this issue persisting, then we need to check the back end logs to understand the cause. Can you please provide the following details to check the logs? Timestamp: Function App version: - Function App name: - Function name(s) (as appropriate): Invocation ID: Region:
I had faced this issue 8 months ago. I changed the service plan from Consumption to paid one and it was working.
Hi @erossini, Closing the issue as resolved, In case of any further concerns regarding this issue, please feel free to re-open the issue.