How to Schedule Python Function Apps at Different Times for Development and Production

Salehabanu Shaikh 1 Reputation point
2022-12-15T17:08:38.153+00:00

Hi,

I want to run my python azure function at different times in the Dev and Prod environments.

First Method:

I attempted to create an Azure configuration variable and feed it through a function.json file, as seen below

271126-image.png

271088-image.png

This method is not working. Python function does not run at all when I deploy it.

Second Method:

I added two binding variables in function.json as seen below. Then, with os.environ["ENVIRONMENT"], I choose the corresponding binding variable, for instance myTimerDev for the dev environment.

271077-image.png

At python side below code
271127-image.png

The Python code is not running, though.

Could you kindly let me know what I am missing or if there is a way for me to have two schedules that run based on the environment?

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

1 answer

Sort by: Most helpful
  1. Salehabanu Shaikh 1 Reputation point
    2023-07-25T12:43:54.21+00:00

    I solved it by myself. The application setting variable can be used in the code using % for example, "schedule" : %schedule%


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.