Creating an Event Grid subscription

In this section, you will learn how to manage events using Event Grid.

Suppose you have a storage account and you want to log what happens inside it (the creation or deletion of blobs, containers, and so on) using an Azure function. To do this, you should go through the following steps:

  1. First of all, you must write your Azure function that implements the event handler:
[FunctionName("EventHandlerFunction")]public static void EventGridHandler([EventGridTrigger]EventGridEvent eventGridEvent, ILogger log){    log.LogInformation(eventGridEvent.EventType);    log.LogInformation(eventGridEvent.Data.ToString());}

The Azure function uses the EventGrid trigger to receive the event payload when it is called by Event ...

Get Mastering Azure Serverless Computing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.