DEV Community

Cover image for Managing Azure Event Grid Dead-Letter events using Cerebrata
Modhana
Modhana

Posted on • Originally published at cerebrata.com

Managing Azure Event Grid Dead-Letter events using Cerebrata

Introduction

Azure Event Grid allows you to easily build applications with event-based architectures. In this blog, we will understand how Cerebrata Cerulean will help us in managing the dead-letter events of the Event Grid Subscriptions that are stored in the storage blobs.

Event Grid Topics and Subscriptions

Event Grid architecture is mainly composed of two components. They are Event Grid Topics and Event Grid Subscriptions. The event sources send the events to the Event Grid Topics. The Event Grid Topics then transmit the events to the Event Grid Subscriptions that are created within the Event Grid Topics based on the filtering configured in them. The Event Grid subscriptions then forward the events to the configured endpoints.

Dead-Letter Events

As we saw earlier, the events are sent to the configured endpoint or destination by the Event Grid Subscriptions. There are some cases in which the Event Grid Subscription cannot deliver those events to the configured endpoint. In such cases, the events will be dropped after the configured number of retries. In such cases, to prevent the loss of events, we can enable dead-lettering in the Event Grid Subscription.

Let us consider a scenario, where a Service Bus Queue is configured as an endpoint to the Event Grid Subscription. When the configured Service Bus Queue gets disabled due to some reason, then the Event Grid Subscription cannot deliver the events received from the Event Grid Topic. In this case, the Event Grid subscription will retry to send these events based on the Retry Policy configured. Once the maximum number of retries is exhausted, the Event Grid Subscription will lose the events. To overcome this event loss, we can enable dead-lettering on the Event Grid Subscription. We can configure any of the storage containers in the Azure Storage account as the dead-letter destination. The events that cannot be delivered to the endpoint will be stored as storage blobs.

Managing the Dead-Letter Events

It is not possible to directly view the dead-letter events of an Event Grid Subscription in the Azure Portal. To access the dead-letter events, we will have to navigate into the configured Storage Account container and traverse through into the folder where the events are stored which is quite a long process. To resubmit these events back to the Event Grid Topic, we will have to use the .Net SDKs or REST APIs to read the events from the storage blobs and to resubmit them back to the Event Grid Topic.

Managing the Dead-Letter Events through Cerebrata

Cerebrata overcomes the pain point of managing the Event Grid Subscription dead-letter events. It is possible to view and manage the dead-letter events by modifying and resubmitting them back to the respective Event Grid Topic and deleting the events based on the business requirements. We will see how Cerebrata simplifies the dead-letter event management here.

Steps in Viewing the Dead-Letter events

• Navigate into the required Event Grid Topic in the corresponding Subscription. The topic can be either a System or a Custom topic.
• Select the required Event Grid Topic to view the subscriptions created within the Event Grid Topic.
• Double click on the required Event Grid Subscription to view the dead-letter events in that Event Grid Subscription.

• All the dead-letter events stored as storage blobs will be listed in the opened tab.
• Select the required event to view the Event details.
• The Event details will be displayed as shown below. The Event details include Event Id, Subject, Event Type, Event Time, Data Version and Event Content.

• We can also find the dead-letter reason and the last delivery outcome of the event.

Steps in modifying and resubmitting the dead-letter events

The dead-letter events of the Event Grid Subscriptions belonging to the Event Grid Custom Topic can be resubmitted once the endpoint configured is ready to receive the events. This can be done at ease using Cerebrata. Follow the below steps to Modify and Resubmit the required events

• Select the required dead-lettered event.
• Select the Modify and Resubmit button.

• The Event details will be displayed in a pop up as shown below.

• The event content can be modified based on the requirements.
• We can also modify the advanced properties like Subject, Type and Data version of the event.
• Select the Save button to complete the resubmission process.

Steps to be followed to delete the Dead-Letter events

• Navigate into the required Event Grid Subscription where the dead-letter events will be displayed.
• Select the required dead-letter events to be deleted.
• Select the Delete button.

• Select the Delete button in the confirmation popup to complete the deletion process.

Other Event Grid Features

In addition to the dead-letter event management of the Event Grid Subscriptions, Cerebrata Cerulean also supports the following features.

• Managing the Tags of Event Grid Custom Topics and Event Grid System Topics
• Managing the Keys of Event Grid Custom Topics

Conclusion

In this blog, we learned about how Cerebrata Cerulean simplifies the process of dead-letter management of Event Grid Subscriptions. Apart from Azure Event Grids, Cerebrata Cerulean enables you to manage your Azure Cosmos DB accounts (SQL API, Gremlin API, and Table API), Storage Accounts, Service Bus Namespaces, Cognitive Search Service accounts, Redis Cache accounts, and much more. It is also cross-platform so that you can manage your Azure resources from a platform of your choice – Windows, Mac, or Linux. Please visit https://www.cerebrata.com to learn more.

Top comments (0)