In this article, we will learn how to edit the Scheduled Expression (the frequency of execution of a timer trigger) using a Configurable item in the App Settings of Azure Functions.
Create an Azure Function App using Azure Portal as shown below. You can use language of your choice.

Once you review all the details, click on Review + Create button to create the Azure Function app. Below is how it looks after you create the Function App.

Now, create an Azure Function project using Visual Studio (prefer latest version) and choose the appropriate Azure Function runtime and then choose Timer Trigger. Once you create the Function app, it should look something as shown below where the Scheduled Expression is hard coded.

It’s a Cron Expression that tell us that the function executes once every 5 minutes. As it is obvious that the expression is hard coded which is not a best practice.
In order to make it dynamic, let use Binding Expressions to make the Cron expression to be a configurable item.
Let’s open the appsettings.json and add a setting called timer-frequency along with the appropriate value as shown below.

Now, create an App Setting with the same key name that you have created for storing the CRON Expression as shown below.

Now, publish the application to the Azure Function app that you have created. Once the application is published, you will be able to view the Timer trigger Function in the Azure Portal as shown below.

Now, click on the Timer trigger and then click on the Monitor tab as shown below. The Monitor tab shows all the invocations.

As the CRON expression that we configured in the App Settings was execute every five minutes, I had to wait for 5 minutes to view the above output.
Let’s change it to one minute by navigating to the Configuration blade as shown below.

Click on OK and then click on Save in the Configuration blade – This is important 😊
Now, go back to Monitor section and you should see the output every one minute as shown below.

That’s it. Happy Serverless programming 🙂
Do you like this article? If you want to get more updates about these kind of articles, you can join my Learning Groups
Is this applicable for older versions as well? Azure timer trigger functions V2 / V1
LikeLike
Definitely, it works in V2. I don’t recommend v1 at all.
LikeLike
How can I set a specific timer using this solution when my function app contains multiple timer triggers?
LikeLike
Do you know of a solution where this schedule can apply to a single trigger in a function app that contains multiple timer triggers?
LikeLike
Is there a way to set a specific triggers’ schedule when a function app contains multiple timer triggers using this method?
LikeLike