Azure timer function is not triggering every day

Nick 0 Reputation points
2025-01-28T00:52:01.1233333+00:00

I have a function app in python with two timer triggered functions. Each timer is set to be triggered every day however there are some days with no executions and no errors logged. I am on the flex consumption plan. What could be causing the timers to not be triggered?

This is the invocations tab:

User's image

Here is my main code:

app = func.FunctionApp()

# Timer trigger for the live environment at 13:10 UTC every day
@app.function_name(name="get_stripe_data_live")
@app.schedule(schedule="0 10 13 * * *", arg_name="mytimer", run_on_startup=False)
def get_stripe_data_live(mytimer: func.TimerRequest):
    process_stripe_data(environment="live")

# Timer trigger for the sandbox environment at 13:20 UTC every day
@app.function_name(name="get_stripe_data_sandbox")
@app.schedule(schedule="0 20 14 * * *", arg_name="mytimer", run_on_startup=False)
def get_stripe_data_sandbox(mytimer: func.TimerRequest):
    process_stripe_data(environment="sandbox")

# Main function for processing stripe data
def process_stripe_data(environment: str):
    logging.info('Python function triggered')

    # Set Stripe api key based on environment argument
    if environment == 'live':
        stripe.api_key = stripe_api_key_live
        logging.info(f'Processing {environment} Stripe data')
    elif environment == 'sandbox':
        stripe.api_key = stripe_api_key_sandbox
        logging.info(f'Processing {environment} Stripe data')
    else:
        logging.error(f'Unknown environment: {environment} Ending execution.')
        return None
 	
	# Rest of code is here

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

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 5,281 Reputation points Microsoft Employee
    2025-01-28T01:14:31.5433333+00:00

    Hi @Nick , I understand that you have an Azure Function with Flex Consumption plan but intermittently missing scheduled trigger.

    Please note that for the Consumption hosting plans you should also manually sync triggers in these scenarios:

    • Deployments using an external package URL with either ARM Templates or Terraform.
    • When updating the deployment package at the same external package URL.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.


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.