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 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.