Automatic triggers in WebJobs

By default, the WebJobs SDK provides a limited set of triggers. Currently, it supports only the following ones:

  • Blob storage
  • Queue storage
  • Table storage

All of these are connected to Azure Storage and will be covered in the chapter describing Azure Functions. Fortunately, we can install additional NuGet packages to extend the functionality of our host. For now, add the Microsoft.Azure.WebJobs.Extensions package so that we will be able to use TimerTrigger. When you have it, call the UseTimers() method on the JobHostConfiguration object:

using Microsoft.Azure.WebJobs;namespace MyFirstWebJobWebJobsSDK{    class Program    {        static void Main()        {            var config = new JobHostConfiguration();            config.UseTimers(); var host = ...

Get Hands-On Azure for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.