Timer triggered Azure Function not getting triggered

Question

I have a function on Azure with the follow function.json file:

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

Unless I'm wrong, this should make the function run once a day, at 3AM ?

This is the signature of the function:

public static async Task Run(TimerInfo myTimer, TraceWriter log) {}

So what is it I'm doing wrong? The function works fine when I manually trigger it (clicking "Run" in the portal), but it didn't run at 3AM this morning, and it didn't yesterday either.

Edit: So, as suggested, I've changed the plan to a paid plan, and I've selected a dynamic plan. The logs still says nothing about the function getting activated at 3AM this morning.

enter image description here

Solution

Apps that run in Classic mode require 'Always On' to be enabled. Double-check that this is enabled -- that would explain it.

There are two plans that Functions apps can run in: Dynamic and Classic. You choose the plan during app creation. There's currently no way to switch plans after the app has been created:

enter image description here

  • Classic Plans run on App Service plans just like other App Service apps. You can choose from Free, Basic, Standard, etc, and you control the scale yourself. If you are using a Classic Plan, you must turn on 'Always On' in order to have triggers fire reliably. This requires your site to be in Basic or Standard mode. You can manage this from your Function App (and check for 'Always On') by clicking 'Function app settings' -> 'Go to App Service Settings'. The 'Always On' setting lives in 'Application settings'.

  • Dynamic Plans are charged by execution. There's no concept of 'Always On' -- when a trigger fires, your site will be started (if it's not already) and your function will run.

See here for more details: https://azure.microsoft.com/en-us/documentation/articles/functions-scale/#choose-a-service-plan