the last type of trigger that woolen about is the so called timer trigger
timer triggers allow you to run your function on a schedule. For example, you can it every five minutes or every hour or once a day at midnight.
Let's see how we can do that in natural portal.
Once again in our azure function, up will click on the plus button to create a new function,
and we'll select the time or tree girl in this case,
wounding our function timer trigger Cyber. The example
and old Eddie
the Wizard suggest that we're in actually every five minutes.
Let's do that. Let's say create
an actual will automatically create a function for us and it will set it up for a timer trigger, and it will also provide our default
What will happen now is that every five minutes will see a log message that will look the information like timer trigger function executed at the time it is executed.
Let's add a little bit more called toe that so well, other check to check whether the timer trigger is delayed,
we'll save it. And of course, we can immediately test that thing.
So when we click on the run button.
There is no request body.
We'll see that the timer trigger is executed at 12. 16
6 42 AM
This is UTC time. Always.
We can wait the next five minutes and see whether this will This function will be executed.
So I waited for several minutes. And as you can see,
they're more executions of our function.
Let's see a little bit more in details. What is happening?
If we go through the locks, you will see that at 6:42 a.m.
We trigger the function manually
and it executed.
The next execution time was supposed to happen. It's 6 45 because we created the function at 6 40
Now, this is intermediate execution that we manually trigger.
If we don't trigger such type of executions,
the normal schedule will take into account. So as you can see 6 45 we had execution of the function. Then for the next four minutes, nothing happened in at 6 50 We executed it once again.
Now you can implement your functionality and you can test your timer on certain amounts easily. You can go and change the schedule just with the configuration file.
You can do this from the Porto. The configuration file that your support is to use is called function. Jason,
I can go and change the schedule toe one minute,
And soon you will see that we will have executions much more often than every five minutes.
Now that I've waited a few more minutes, you can see that after our change in the function toe from the schedule or run the function every minute we see execution every minute. So we have execution at 6 52 a swell of 6 53 and so on.
I can go back and change the schedule to every five minutes. But because I don't wanna waste money on my azure account, one thing I can do is I can go and turn off the function so I will turn off the time trigger function.
That's where was the cute trigger function
because they will be executing every time when there is, ah, time for execution for the time three get or when there is a message for the Q trigger.
This is how you can create a
actual function that this trigger on specific schedule
so This is the last example for this model. Let's wrap up our model and learn about some security features for rational functions.
Create a Serverless API using Azure Functions
Azure in a public cloud computing platform. Azure gives users options for serverless computing ...
Learn On Demand
AZ-301 Microsoft Azure Architect Design
This AZ-301 training covers the skills that are measured in the Microsoft Azure Architect Design ...
15 CEU/CPE Hours Available
Certificate of Completion Offered