Overview​
Azure Event Grid Viewer simplifies the testing and monitoring of Azure Event Grid subscriptions by offering a convenient interface to view and validate events. It empowers you to ensure the proper functioning of event-driven applications, identify potential issues, and gain insights into the event stream. By utilizing this tool, you can save time and effort in debugging and troubleshooting event grid implementations.
Azure Event Grid Viewer is a tool that simplifies the testing and monitoring of Azure Event Grid subscriptions. This tool provides a user-friendly interface for visualizing and validating the events being published to Event Grid. By leveraging Azure Event Grid Viewer, developers and integrators can easily debug, troubleshoot, and test their event-driven processes and systems.
The Azure Event Grid Viewer sample, available on the Microsoft documentation website, offers a comprehensive example of how to implement an event grid viewer. It demonstrates how to create a real-time event grid monitoring solution that displays events as they are received. With the sample, you can quickly set up a local or cloud-based instance of the event grid viewer, configure the necessary endpoints and authentication, and start monitoring an event grid subscription.
Event Grid Viewer will allow you to visualise the events in real-time as they are published, providing instant feedback on event generation and delivery. This helps in verifying that the events are being published correctly and that the subscribers are receiving them as expected. The viewer also enables easy troubleshooting by displaying event details, including the event payload, headers, and metadata. This allows you to inspect the content of the events and identify any issues or discrepancies in the data being sent
Useful Starting Info​
To test events are being published and to be able to view the published events we will use a Microsoft utility called Azure Event Grid Viewer.
-
Instructions to deploy the app into the Apporetum resource group can be found at the following site: https://learn.microsoft.com/en-us/samples/azure-samples/azure-event-grid-viewer/azure-event-grid-viewer/
-
A detailed blog about the utility can be found here: https://madeofstrings.com/2018/03/14/azure-event-grid-viewer-with-asp-net-core-and-signalr/
An updated version with a React based UI can be found here.
Deploying Event Grid Viewer​
- Start by clicking here
This will launch Azure Portal and ask you to authenticate. Make sure you have the correct permissions to be able to deploy the web application onto one of your subscriptions in your tenant.
- Fill in the details under Basics
- Click Review and create tab to double check if the information you put is correct
- Click Create to trigger the deployment process
- Wait then Check if "Your deployment is complete"
- Go to the deployed web App resource and copy the Default domain from the Overview tab
You will need this value to subscribe to the events in the next section.
- Open your browser and paste the url of the Default domain into your browser. You should see the Azure Event Grid Viewer
If you see this page blow in your browser it means that the web application has been deployed successfully.
Set Up Event Grid Viewer to Subscribe to the Apporetum Event Grid Domain​
- Open Azure portal
- Navigate to the Event Grid Domain resource that was set up in the previous steps in Deploying Event Grid Viewer
- Under Entitles menu tab, select Domain-Scope Event Subscriptions
This will display all service subscribed to the Event Grid.
- At the top page, click + Event Subscription
- Enter details to subscribe to the Apporetum Events
-
Enter a descriptive name in the Name field to identify the service subscribing to the events
-
Uncheck the Scope to domain topic checkbox
-
Select Web Hook from the Endpoint Type menu in the Endpoint Details section
-
Click Select an endpoint and paste in the Default domain from the previous section. Enter the following to the Default domain url - "/api/updates" so the webhook endpoint looks like this:
https://{Default domain}/api/updates
-
Click Create button to complete the setup of the subscription
-
If the configuration has been completed successfully an event will be shown in the EventGridViewer showing that the Event Grid subscription has been established.
-
Example of Azure Event Grid Viewer receiving Apporetum events
Additional Subscription Configuration​
Filtering Apporetum Event Types​
- Open Azure portal
- Navigate to the Event Grid Domain resource
- Select Domain-Scope Event Subscriptions to see the services subscribed to the Apporetum topic
- Click on the event subscription name to show the Subscription details
- Select Filters
From this blade in the portal you will be able to add filters for specific event types, event subjects that are sent to the end point. With filters you can filter on specific event types or by subject.
- Access Events: are published when someone adds or removes an account from an App role a. Apporetum.Access.Add b. Apporetum.Access.Remove
- Membership Events: are published when the entitlement is added, removed or updated. a. Apporetum.Membership.Create b. Apporetum.Membership.Update c. Apporetum.Membership.Delete
Filtering Apporetum Subjects​
- Open Azure portal
- Navigate to the Event Grid Domain resource
- Select Domain-Scope Event Subscriptions to see the services subscribed to the Apporetum topic
- Click on the event subscription name to show the Subscription details
- Select Filters
- Select the Enable subject filtering. This will show the subject filtering options
- Enter the section of the Event subject you wish to filter on. The Apporetum event subject has the following structure:
DataSource/{Data Source GUID}/App/{App GUID}/Role/{Role GUID}
For example, "subject": "DataSource/860403b6-4685-4ebe-9a96-baffffc3adce/App/f8ac4912-2c3e-4128-c347-08db191854c1/Role/3cc77341-a9ee-488b-ba39-08db1919d4bc",
Additional subscription options​
From the subscription blade you will also be able to add specific retry policies, dead-lettering and add specific headers to the events that are sent to the end point.