You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
While system topics let you react to Azure service events, custom topics allow you to publish your own events from any application. Event domains take this further by providing a single management endpoint for thousands of related topics. This lesson covers how to create and use custom topics, how to secure them, and when to use event domains for large-scale scenarios.
A custom topic is an Event Grid endpoint that you create to publish events from your own applications. Any service — a web API, a background worker, an IoT device — can send events to a custom topic using HTTP POST.
az eventgrid topic create \
--name app-events \
--resource-group rg-messaging \
--location uksouth \
--input-schema eventgridschema
After creation, the topic has an endpoint URL and two access keys:
az eventgrid topic show --name app-events --resource-group rg-messaging --query "endpoint"
az eventgrid topic key list --name app-events --resource-group rg-messaging
import { EventGridPublisherClient, AzureKeyCredential } from '@azure/eventgrid';
const client = new EventGridPublisherClient(
'https://app-events.uksouth-1.eventgrid.azure.net/api/events',
'EventGrid',
new AzureKeyCredential(topicKey)
);
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.