Azure Function Python V2 Timer Trigger Not Executing

william T 0 Reputation points
2025-12-23T16:38:54.7+00:00

I'm having trouble setting up Azure Function Python v2 for timer trigger.

I have the following decorator with %Schedule% set to 0 0 23 * * 2 which should be 11PM UTC time.

@app.timer_trigger(schedule="%Schedule%", arg_name="myTimer", run_on_startup=False, use_monitor=False)	

However, it never triggers.

Also I'm on Flex Consumption plan if that matters.

Can anyone help please?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-23T16:39:02.66+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems you are experiencing issues with your Azure Function's timer trigger not executing as expected. Here are a few things to check:

    1. Schedule Format: Ensure that the CRON expression you are using (0 0 23 * * 2) is correct and aligns with the expected format for Azure Functions. This expression should trigger at 11 PM UTC on Tuesdays.
    2. Function App Configuration: Make sure that your function app is properly configured to use the v2 programming model. The Python v2 programming model is only supported in the 4.x functions runtime, so ensure that your function app is running on the correct version.
    3. Monitoring: Since you have set use_monitor=False, consider setting it to True to enable monitoring of the schedule. This can help you diagnose if the function is being triggered but failing to execute properly.
    4. Logs and Errors: Check the logs for any errors or warnings that might indicate why the timer trigger is not firing. Look for any issues related to the timer trigger in the Azure portal.
    5. Run on Startup: If you want the function to trigger immediately when the function app starts, you can set run_on_startup=True. This will help you verify if the function is set up correctly.

    If you've checked all of these and the issue persists, consider reviewing the troubleshooting documentation for Python functions in Azure Functions for additional insights.


    References:

    0 comments No comments

  2. Pravallika KV 4,595 Reputation points Microsoft External Staff Moderator
    2025-12-24T03:14:29.7333333+00:00

    Hi william T,

    Thanks for reaching out to Microsoft Q&A.

    I faced the same issue when I tried to replicate the same initially.

    Below steps worked for me:

    • Created a new function app (Flex consumption plan).
    • Deployed below python function to Azure:
    import azure.functions as func
    import datetime
    import json
    import logging
    
    app = func.FunctionApp()
    
    @app.timer_trigger(schedule="%Schedule%", arg_name="myTimer", run_on_startup=False,
                  use_monitor=False) 
    def timer_trigger(myTimer: func.TimerRequest) -> None:
        
        if myTimer.past_due:
            logging.info('The timer is past due!')
    
        logging.info('Python timer trigger function executed.')
    

    Added Schedule App Setting under Environment Variables in function app.

    The value should be the time converted to UTC.

    Example: I have scheduled a trigger at 2:15 AM UTC. CRON expression 0 15 2 * * 3 used.image

    Able to trigger the function at scheduled time:

    imageHope it helps!


    Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.

    User's image

    If you have any other questions, let me know in the "comments" and I would be happy to help you.


Your answer

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