Azure Function App Only Runs When In Azure Portal

Michael C 21 Reputation points


I have recently Published an Azure Function from Visual Studio. The function is setup to trigger every 15 minutes. This works fine when I am logged in to the Portal but when I'm not logged in the function does not trigger.

Things I have tried:

Like I say the Function App works exactly as I expect it to when I am logged in so I've obviously done something wrong when publishing/setting up the Function.

Any help would be appreciated!

I'm not sure if the page is still relevant but I have included the requested information regardless:

  1. Are you using Consumption or App Service Plan - Consumption
  2. If Consumption, how did you deploy? If App Service Plan, do you have Always On enabled? - I deploy the function using 'Publish' in Visual Studio 2019
  3. Are you using the v1 runtime, or the v2 (Preview) runtime? - v3.0
  4. Are you setting WEBSITE_TIME_ZONE? - No
  5. What is your CRON expression set to, and what is your expectation about what it means. - I expect the function to fire every 15 minutes. My CRON syntax is included below.
  6. Give a specific UTC time at which you expected your function to get called, and found that it wasn't. Also, explain how you are determining that it is not getting called. If some cases, the function may get called, but it may not be obvious due to some logging issue - The overview in the Azure Portal shows that it hasn't been run. Also the Function would make an entry in to a database table each time it runs
  7. And most importantly, include a sample invocation ID so we can find your app and look into the issue - Region is UK South invocation ID is below:

Executing 'UpdateMeterReadings' (Reason='Timer fired at 2021-02-14T15:00:00.0099970+00:00', Id=b77b5b73-37cf-4c80-8469-5395b52b7088)

Function Code and CRON syntax:

public void Run([TimerTrigger("*/15 * * * *")]TimerInfo myTimer)  
     _log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");  
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,693 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nasreen Akter 10,706 Reputation points

    Hi @MichaelCruse-4449,

    I think you are only missing a 0 at the beginning of your CRON expression.

     It should be 0 */15 * * * * instead of */15 * * * *. 


    If the above response is helpful, please Accept as Answer and Upvote it. Thanks!

2 additional answers

Sort by: Most helpful
  1. Shubham Tomar 1 Reputation point

    Hi @Michael C @Nasreen Akter
    I am facing same problem but in my case I have not set any time to trigger blob storage. Instead I just want, when I upload a file to azure blob storage, the function app triggers the blob immediately. It works fine when I log in to Function App Portal, but when I log off or close the log stream in Function App Portal the Function App doesn't trigger the blob.

    Kidly, please help me to resolve this issue.

    Plese answer here or there

    0 comments No comments

  2. Shubham Tomar 1 Reputation point

    Now I got it:-

    Polling and latency
    Polling works as a hybrid between inspecting logs and running periodic container scans. Blobs are scanned in groups of 10,000 at a time with a continuation token used between intervals. If your function app is on the Consumption plan, there can be up to a 10-minute delay in processing new blobs if a function app has gone idle.

    If you require faster or more reliable blob processing, you should instead implement one of the following strategies:

    • Change your binding definition to consume blob events instead of polling the container. You can do this in one of two ways:
      • Add the source parameter with a value of EventGrid to your binding definition and create an event subscription on the same container. For more information, see Tutorial: Trigger Azure Functions on blob containers using an event subscription.
      • Replace the Blob Storage trigger with an Event Grid trigger using an event subscription on the same container. For more information, see the Image resize with Event Grid tutorial.
    • Consider creating a queue message when you create the blob. Then use a queue trigger instead of a blob trigger to process the blob.
    • Switch your hosting to use an App Service plan with Always On enabled, which may result in increased costs.

    It's mentioned in the documentation itself

    0 comments No comments