Azure Function App stopped triggering on Storage Uploads

Andrey Kozichev 0 Reputation points
2025-02-24T12:31:45.5466667+00:00

Hello! I've been using Azure Function APPs to process files uploaded into a Storage Account. 

I am using the default Storage Polling mechanism described here https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cextensionv5&pivots=programming-language-python

It does tell that it can take up to 10 minutes to detect the changes, but this is not a problem for my use case. 

I use Consumption Plan and have two Function apps written in Python and Node, both are Linux.

Lately - approximately a week both of the function apps stopped triggering completely, even though new files were being added to the storage container.

I can't see any Errors in the Logs or in Applicationinsights.

!!! Both function apps start processing straight away when I only connect to a log streaming or function app console. 

I understand the issue with the cold start and can cause delays, but not triggering completely. The times we are talking are in Days and Weeks. 

I've seen in similar issues the recommendation is to switch to a Premium plan, but that will ruin the purpose of using an event-driven system. I don't need a function app running all the time. 

Appreciate any advice or workarounds.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,504 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dasari Kamali 85 Reputation points Microsoft External Staff
    2025-03-06T07:08:25.88+00:00

    Hi @Andrey Kozichev ,

    Thank you for reaching out to MS Q&A.

    This happens because the part of the Function App that watches for new files in the Storage Account sometimes goes inactive and doesn’t start checking for new files when they’re added. That’s why it only starts working when you open log streaming or the console, it restarts the function’s listener.

    To resolve the issue,

    • Ensure "Always On" is enabled and the AzureWebJobsStorage connection is valid with proper storage firewall settings.
    • Make sure the WEBJOBS_DISABLE_SCHEDULE setting isn’t set to 1, if it is, the function’s triggers won’t work. Refer to the MS Doc for a better understanding.

    To prevent the Function App from going idle, add a simple Timer trigger that runs every 5–10 minutes to keep the app active.

    python :

    
    import datetime
    
    import logging
    
    import azure.functions as func
    
    app = func.FunctionApp()
    
    @app.function_name(name="mytimer")
    
    @app.timer_trigger(schedule="0 */5 * * * *", 
    
                  arg_name="mytimer",
    
                  run_on_startup=True) 
    
    def test_function(mytimer: func.TimerRequest) -> None:
    
        utc_timestamp = datetime.datetime.utcnow().replace(
    
            tzinfo=datetime.timezone.utc).isoformat()
    
        if mytimer.past_due:
    
            logging.info('The timer is past due!')
    
        logging.info('Python timer trigger function ran at %s', utc_timestamp)
    
    

    nodejs :

    
    const { app } = require('@azure/functions');
    
    app.timer('timerTrigger1', {
    
        schedule: '0 */5 * * * *',
    
        handler: (myTimer, context) => {
    
            context.log('Timer function processed request.');
    
        },
    
    });
    
    

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.