Azure Functions, Timer Triggers

Alberto De Natale
2 min readJun 17, 2019

--

When working with functions one of the things that surprises the most is how much opportunity there is for integrating them with other Azure products.

In this article, I will look at timer triggers and their powers.

Timer Trigger

Have you ever worked with scheduled jobs or Windows Services?

Their cloud equivalent would be timer triggered Azure Function. WebJobs would also serve the purpose, but in most scenarios, Azure Functions are the way to go.

Cron scheduling

Azure Timer Tiggers come shipped with Cron like scheduling (similarly to what happens on Unix, well described here).

Some examples here:

Run a task every 5 minutes

0 */5 * * * *

Run at 00.00 on Sunday

0 0 0 * * Sun

Create the trigger

This is the default template that comes shipped from Visual Studio.

I will launch and run it in Visual Studio:

The breakpoint will eventually hit, I changed the interval to every 5 seconds.

After publishing from Visual Studio, I can verify that the function is running as expected:

Conclusions

Azure functions with a timed trigger are the cloud equivalent of Scheduled Tasks and Windows Services.

--

--

Alberto De Natale
Alberto De Natale

Written by Alberto De Natale

Alberto De Natale is a passionate tech-enthusiast software developer.

No responses yet