Updated June 21, 2023
What is Azure Event Grid?
Microsoft Azure Event Grid is a service where users can build serverless applications quickly with event-based architecture. It is an event routing service that distributes events from sources like Blob Storage, Media Services to Azure functions, and Webhooks. Event Grid can be used as a Third-party service and supports Azure services as a publisher or Subscriber. It has the support to create its event using custom topics.
How does Azure Event Grid Work?
Azure event grid receives messages from multiple sources and distributes these messages using an event handler based on the event grid subscription. Event sources send the event’s details to the Event grid, and then relevant events from the grids are forwarded to the Subscriber. Topics segregate the appropriate circumstances and decide which events to send to the event handlers. Each event from the sources is tagged to multiple issues, and event handlers subscribe to the intended topics from events.
As illustrated in the figure above Azure event grid uses the below components to connect to the source and Subscriber:
- Events: It is the notification of certain conditions or the state change of what happened in the application.
- Event Sources: Sources where the event is running or executing. Event sources used are Event Hubs, IoT Hubs, Blob Storage, etc.
- Topics: It is the endpoint to receive events from publishers.
- Event Subscriptions: The built-in mechanism the endpoint uses to route the events to the single or multiple event handlers. Subscriptions decide relevant events from incoming events.
- Event Handlers: It is a service or apps like Event Hubs, Queue Storage, WebHooks, etc., to react to events.
How to CrAd Use Azure Event Grid?
Before learning to create the Azure Event Grid, users must have an Azure Subscription to log in with valid credentials to the Azure Portal and create Azure Event Grid.
Create a Custom Topic
Step 1: Use a valid credential to Login into the Azure Portal :
Step 2: Select the search bar field and enter the Event Grid Topics, and from the drop-down list, click on the Event grid topics:
Step 3: From the Event Grid Topics page toolbar, select the+Add option to create add a new topic:
Step 4: In Create Topic page, users can enter the topic details as per requirement:
- Select the Azure Subscription and Create a new resource group if needed or use the existing one from the drop-down list.
- Enter the Topic name in the Name field, and the title should be unique as it represents the DNS.
- Select the Location from the drop-down list.
Step 5: Click on the Review+create to validate the entered detail and then click on the Create button from the bottom of the page:
Step 6: Deployment of the Topic will Start, and Once the Deployment is completed topic will be available in the Event Grid Topic list.
Create a Message Endpoint
Users must create a subscription for the custom topic and an endpoint for the event message. We are using a pre-built web app to display event messages:
Step 7: Click on Deploy to Azure link below and provide the deployment parameters on the page:
Enter the details by selecting the Housing Plan, Site Name, and Regions:
Create Event Subscription
Step 8: In the Search, field eentersEvent grid Subscription to create a new subscription:
Step 9: Select + Event Subscription to add a new subscription:
Step 10:Enter the event subscription detail in the Create Event Subscription:
Step 11: Enter the details in Create Event Subscription:
- Name: Enter the Unique name of the Subscriber.
- Select Event Schema as Event Grid Schema from the Drop Down List.
- In topic types, select Event Grid Topics.
- Select Subscription, Resource group, and Resource as per your subscription.
- Select the Endpoint Type created above.
Step 12: Click on the Create button from the link of the Create Event Subscription page and start Deployment:
Step 13: It will start the Deployment to create and Subscriber.
- Azure Event Grid is simple and easy, as Users can point and click the events from Azure Resource to any event handler or endpoint.
- It supports many built-in events so users can get up and run resources faster and with low latency.
- It has high reliability as the event grid runs 24 hours and ensures that events are delivered successfully.
- Users can filter the event type and event published path to decide which events to select from the event handler.
- Users can only pay for the used resources as there is support for Pay-per-event.
In conclusion, Azure Grid Event helps users to build applications quickly, and users can also publish or subscribe to the message needed. Due to the pay-per-pricing model, users have to pay for what they are using.
This is a guide to Azure Event Grid. Here we discuss an introduction to Azure Event Grid, working, and steps to create Azure Event Grid. You can also go through our other related articles to learn more –