Working with HTTP and Timer Triggers

Lab Details

  1. In this lab, we will walk through the usage of HTTP and Timer Triggers in Azure Functions.

  2. Duration: 30 minutes

Introduction

What are HTTP and Timer Triggers?

  • Azure Function is an Azure Service from Microsoft that helps you to run some pieces of code smoothly without getting worried about the infrastructure for your application. 

  • The HTTP trigger lets you invoke a function with an HTTP request. You can use an HTTP trigger to build serverless APIs and respond to webhooks.

  • The main work of the Azure Function HTTP Trigger is to invoke the Azure Function with the HTTP Request. 

  • HTTP Trigger is the basic and simplest trigger of an Azure Function. Mostly, People use the HTTP Trigger while performing the operation with the Azure Function.

  • One of the triggers for Azure Functions is the timer-trigger – allowing you to run a function on a schedule. With the timer trigger, you can use cron-expression to define when the function needs to run.

  • The time-triggered Azure Function allows us to schedule time for executing the function. It means that it triggers the function at a specified time. It works as CRON expressions work. When creating a time-triggered function, we need to specify a time in CRON format that determines when the trigger will execute. The CRON expression consists of six parts - second, minute, hour, day, month, and day of the week in Azure Function and each part is separated by space. 

Task Details

  1. Launching Lab Environment

  2. Create a Function App

  3. Add a Function using HTTP Trigger template

  4. Using HTTP Trigger

  5. Add a Function using Timer Trigger template