Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Timer triggered function on app service plan not triggering on time

Open keidyz opened this issue 2 years ago • 9 comments

The function is meant to run once a day at a specified time but it seems to be running flakily, sometimes just running once a week.

The function's always-on toggle is set to false and I do see on https://learn.microsoft.com/en-us/azure/azure-functions/dedicated-plan that it is advised to turn it on for app service plans and that only http triggers will turn on the function.

If only http triggers will turn on the function- why does this timer triggered function still get triggered then, albeit flakily?

We have also noticed the same flakiness for functions triggered by service-bus queues. The function is also in an app service plan and is not set to always-on.

keidyz avatar Jul 03 '23 06:07 keidyz

Hi @keidyz , thanks for reporting, can you share the repro steps of this issue. Thanks

AnandKhobragad avatar Jul 05 '23 08:07 AnandKhobragad

Hi @AnandKhobragad

To replicate:

  • Create an Azure function that uses a timer trigger
// sample function.json for the timerTriggered function
// it is important that the schedule doesn't trigger the function frequently, at least enough to let the function sleep
{
  "bindings": [
    {
      "name": "time",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 5 * * *"
    }
  ]
}
  • Deploy the function into an app service plan
  • Ensure that the function's alwaysOn toggle is set to false
  • Observe that the function does not always get triggered but gets triggered flakily

Using the example json above, the function is supposed to get triggered every 5 am once a day but we've observed the function not being triggered for around 3 days and then being triggered the day after without intervention.

keidyz avatar Jul 05 '23 20:07 keidyz

yes seems plan not triggering on time we investigating. pls refer this doc: https://markheath.net/post/three-ways-view-error-logs-azure-functions

https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-exceptions#diagnosing-failures-using-the-azure-portal

@fabiocav pls comment

bhagyshricompany avatar Jul 17 '23 11:07 bhagyshricompany

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

ghost avatar Aug 05 '23 12:08 ghost

No error log is appearing. Just nothing.

keidyz avatar Aug 05 '23 22:08 keidyz

pls share the app name,function name ,invocation id, timestamp region etc.

bhagyshricompany avatar Aug 07 '23 07:08 bhagyshricompany

App name: adg-shared-functions-staging Function name: storage-table-backupper App insight location is at West Europe No specific invocation ID, this happens all the time randomly

keidyz avatar Aug 07 '23 08:08 keidyz

timestamp ?

bhagyshricompany avatar Aug 09 '23 11:08 bhagyshricompany

@bhagyshricompany The function is supposed to run once a day at 5AM

Most recent missed date occurred on August 10. Previous log prior to that was on 2023-08-09T03:04:22.4352414Z and it was followed by 2023-08-11T09:29:13.8110811Z

keidyz avatar Aug 16 '23 23:08 keidyz

Closing the issue as there is no recent activity.

JAdluri avatar Feb 18 '25 14:02 JAdluri