In this article, I will explain all about time-triggered functions using Azure Functions App. Before getting into implementation, let’s have an overview of Azure Functions. Azure Functions is a solution for running small lines of code in the Cloud, and we can select the programming language as per our desire. We can build the code that we need at a small level so that we need not worry about the whole application for running it. Azure Functions applications let us develop serverless applications. Now, let us come to the Azure time-triggered functions.
A time-triggered function allows the users to schedule a time for executing the particular function. It means that it will trigger a particular function on the correct scheduled time. As we are speaking of Azure time-triggered functions, it will work based on CRON expressions. When we create a time-triggered function, the user is needed to give time in CRON format which will determine when should the trigger be executed. So, coming to point, CRON expression consists of six parts - second, minute, hour, day, month, and it should be specified in the following expression.
- Asterisk (*) is used to express that the expression can have any value
- Hyphen (-) is used to indicate a range of values
- comma (,) is used in the specification of listing of values
- Forward slash (/) is used to reoccur the execution time.
I have provided the expressions and description on CRON examples listed below,
|
Expression
|
Description
|
|
0 * * * * *
|
Every minute
|
|
0 */2 * * * *
|
Every 2 minute
|
|
*/1 * * * * *
|
Every second
|
|
0 0 * * * *
|
Every hour
|
|
0 0 0 * * *
|
Every day
|
|
0 30 11 * * *
|
Every day at 11:30:00
|
|
0 0 5-10 * * *
|
Every hour between 5 to 10
|
|
0 0 0 * * SAT
|
Every Saturday
|
|
0 0 0 * * 6
|
Every Saturday
|
|
0 0 0 * * 1-5
|
Every workday
|
|
0 0 0 * * SAT, SUN
|
Every Saturday & Sunday
|
|
0 0 0 1 1 *
|
Every year 1st Jan
|
|
0 0 0 1-7 * SAT
|
Every first Saturday of month
|










Join the conversation! Your thoughts help the community grow.