6

Note: Even though it may seem duplicate, My issue is different and I request you to read complete description before hastily marking the question down just by reading Question title.

I opened "Azure function is not triggering on scheduled time " issue on official "azure-webjobs-sdk-script" git repository on May 24, 2017-but there is no reply yet. So I am re-asking this here.

I am using azure function in consumption plan, and have scheduled it to execute at every 4.00 am utc by setting following cron expression in function.json:

{  

"bindings": [
    {
      "name": "myTimer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 4 * * *"
    }
  ],
  "disabled": false
}

Azure function does get execute on time only if I am logged into portal or clicks on function blade. It does not invoke when I am logged out from portal (suggesting either system listener or function go to sleep after some interval).

Their official documentation states that functions in consumption plan do not require any other settings (like Always on) to keep the function alive, instances of the Azure Functions host are dynamically added and removed based on the number of incoming events.. So as per documentation, no other settings I have to configure to execute function in consumption plan.

What I have tried?

  1. From "Timer triggered azure function not getting triggered" question on SO, I re-checked and ensured my plan (consumption plan) and time zone. (I want it to run in utc, so no explicit setting is required)

  2. From "#1445: Azure function timer trigger not firing" git issue, I checked whether it was just logs that are not appearing. But I am certainly sure, that its not the logs but the actual function does not get triggered unless I am having my portal on or trigger it manually.

  3. I tried to check whether this behavior exists if I change the schedule to a more closer recursive invocations--I scheduled function to get executed at every 2 hours, and this schedule perfectly worked even when I logged out or did not awake function manually. This means, there is some issue when schedule is set to run on larger set of intervals (in my case each day)

Karan Desai
  • 3,012
  • 5
  • 32
  • 66
  • Is it still the same Function App as referred to in the GitHub issue? If so, it seems to have a schedule of `0 0 */2 * * *`, and not `0 0 4 * * *`. And it looks like it's getting executed every two hours (as expected), though the strange thing is it's running 30 minutes after the hour. e.g. 08:30, 10:30, 12:30, ... Are you sure you don't have a timezone set? – David Ebbo May 30 '17 at 15:03
  • I checked and the timezone is set to 'India Standard Time', which explains the 30 minute part. So as it stands, everything is working as expected. – David Ebbo May 30 '17 at 16:14
  • @DavidEbbo Thanks for responding. No, it is *not* the same function which is referred in github issue. We had to change it due to our own commitments of completing the project. And as mentioned here and on github as well, function *does* get execute for schedules that invoke in less time interval (2 hour), but do not get execute for an interval of day (in my case). We thought the Id we provided (on github) will be enough to let you know the execution time of that function. Anyways, for your reference, I am creating a new function with same scenario to help you investigate. – Karan Desai May 31 '17 at 02:33
  • 1
    Related to the title problem [TimerTrigger fires at unexpected times when RunOnStartup = true #315](https://github.com/Azure/azure-webjobs-sdk-extensions/issues/315) – Michael Freidgeim Nov 11 '17 at 14:01

1 Answers1

1

As discussed here in #1534, deleting and redeploying the function completely in new function app did not reproduce the issue. So deleting the function and/or function app-and redeploying the same should make things working. Meanwhile, Azure team has announced to add internal logging which will help future diagnosis.

Karan Desai
  • 3,012
  • 5
  • 32
  • 66