question

SujitMaharjan-4013 avatar image
0 Votes"
SujitMaharjan-4013 asked kobulloc-MSFT answered

azure function(python) Timer trigger function only triggers when opening azure portal or when app gets http trigger

I am trying run a timer triggered azure function but its only triggers when I open the azure portal or the another function of the app gets the http trigger.

Executing 'Functions.notification' (Reason='Timer fired at 2020-06-05T06:25:14.9220161+00:00', Id=2bb79f08-d123-4316-93a4-072168c9ad3e)
Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2020-06-05T00:45:00.0000000+00:00
Python timer trigger function ran at 2020-06-05T06:25:17.762274+00:00

Runtime verson:3.0.13353.0
Python versoin:3.6
Consumption plan.

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

kobulloc-MSFT avatar image
1 Vote"
kobulloc-MSFT answered

One of the first things I'd recommend is to check is runOnStartup and make sure that is set to false:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python#configuration

Another thing I would look into if the function is firing more often than expected, is the possibility that it is triggering faulty IsPastDue logic. There is a great write-up on this where the short term work around was to run the function in its own AppServicePlan with no scale out configuration:
https://www.redarris.com/2019/11/16/rogue-timer-triggers.html

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.