You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-grid/event-domains.md
+47-4Lines changed: 47 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,22 @@
2
2
title: Event Domains in Azure Event Grid
3
3
description: This article describes how to use event domains to manage the flow of custom events to your various business organizations, customers, or applications.
4
4
ms.topic: conceptual
5
-
ms.date: 11/17/2022
5
+
ms.date: 10/09/2023
6
6
---
7
7
8
8
# Understand event domains for managing Event Grid topics
9
-
An event domain is a management tool for large number of Event Grid topics related to the same application. You can think of it as a meta-topic that can have thousands of individual topics. It allows an event publisher to publish events to thousands of topics at the same time. Domains also give you authentication and authorization control over each topic so you can partition your tenants. This article describes how to use event domains to manage the flow of custom events to your various business organizations, customers, or applications. Use event domains to:
9
+
An event domain is a management tool for large number of Event Grid topics related to the same application. You can think of it as a meta-topic that can have thousands of individual topics. It provides one publishing endpoint for all the topics in the domain. When publishing an event, the publisher must specify the target topic in the domain to which it wants to publish. The publisher can send an array or a batch of events where events are sent to different topics in the domain. See the [Publishing events to an event domain](#publishing-to-an-event-domain) section for details.
10
+
11
+
Domains also give you authentication and authorization control over each topic so you can partition your tenants. This article describes how to use event domains to manage the flow of custom events to your various business organizations, customers, or applications. Use event domains to:
10
12
11
13
* Manage multitenant eventing architectures at scale.
12
14
* Manage your authentication and authorization.
13
15
* Partition your topics without managing each individually.
14
16
* Avoid individually publishing to each of your topic endpoints.
15
17
18
+
> [!NOTE]
19
+
> Event domain is not intended to support broadcast scenario where an event is sent to a domain and each topic in the domain receives a copy of the event. When publishing events, the publisher must specify the target topic in the domain to which it wants to publish. If the publisher wants to publish the same event payload to multiple topics in the domain, the publisher needs to duplicate the event payload, and change the topic name, and publish them to Event Grid using the domain endpoint, either individually or as a batch.
@@ -33,11 +38,15 @@ Subscribing to events for a topic within an event domain is the same as [creatin
33
38
34
39
### Domain scope subscriptions
35
40
36
-
Event domains also allow for domain-scope subscriptions. An event subscription on an event domain will receive all events sent to the domain regardless of the topic the events are sent to. Domain scope subscriptions can be useful for management and auditing purposes.
41
+
Event domains also allow for domain-scope subscriptions. An event subscription on an event domain receives all events sent to the domain regardless of the topic the events are sent to. Domain scope subscriptions can be useful for management and auditing purposes.
37
42
38
43
## Publishing to an event domain
39
44
40
-
When you create an event domain, you're given a publishing endpoint similar to if you had created a topic in Event Grid. To publish events to any topic in an event domain, push the events to the domain's endpoint the [same way you would for a custom topic](./post-to-custom-topic.md). The only difference is that you must specify the topic you'd like the event to be delivered to. For example, publishing the following array of events would send event with `"id": "1111"` to topic `foo` while the event with `"id": "2222"` would be sent to topic `bar`:
45
+
When you create an event domain, you're given a publishing endpoint similar to if you had created a topic in Event Grid. To publish events to any topic in an event domain, push the events to the domain's endpoint the [same way you would for a custom topic](./post-to-custom-topic.md). The only difference is that you must specify the topic you'd like the event to be delivered to. For example, publishing the following array of events would send event with `"id": "1111"` to topic `foo` while the event with `"id": "2222"` would be sent to topic `bar`.
When using the **Event Grid event schema**, specify the name of the Event Grid topic in the domain as a value for the `topic` property. In the following example, `topic` property is set to `foo` for the first event and to `bar` for the second event.
41
50
42
51
```json
43
52
[{
@@ -65,6 +74,40 @@ When you create an event domain, you're given a publishing endpoint similar to i
65
74
"dataVersion": "1.0"
66
75
}]
67
76
```
77
+
# [Cloud event schema](#tab/cloud-event-schema)
78
+
79
+
When using the **cloud event schema**, specify the name of the Event Grid topic in the domain as a value for the `source` property. In the following example, `source` property is set to `foo` for the first event and to `bar` for the second event.
80
+
81
+
If you want to use a different field to specify the intended topic in the domain, specify input schema mapping when creating the domain. For example, if you're using the REST API, use the [properties.inputSchemaMapping](/rest/api/eventgrid/controlplane-preview/domains/create-or-update#jsoninputschemamapping) property when to map that field to `properties.topic`. If you're using the .NET SDK, use [`EventGridJsonInputSchemaMapping `](/dotnet/api/azure.resourcemanager.eventgrid.models.eventgridjsoninputschemamapping). Other SDKs also support the schema mapping.
82
+
83
+
```json
84
+
[{
85
+
"source": "foo",
86
+
"id": "1111",
87
+
"type": "maintenanceRequested",
88
+
"subject": "myapp/vehicles/diggers",
89
+
"time": "2018-10-30T21:03:07+00:00",
90
+
"data": {
91
+
"make": "Contoso",
92
+
"model": "Small Digger"
93
+
},
94
+
"specversion": "1.0"
95
+
},
96
+
{
97
+
"source": "bar",
98
+
"id": "2222",
99
+
"type": "maintenanceCompleted",
100
+
"subject": "myapp/vehicles/tractors",
101
+
"time": "2018-10-30T21:04:12+00:00",
102
+
"data": {
103
+
"make": "Contoso",
104
+
"model": "Big Tractor"
105
+
},
106
+
"specversion": "1.0"
107
+
}]
108
+
```
109
+
110
+
---
68
111
69
112
Event domains handle publishing to topics for you. Instead of publishing events to each topic you manage individually, you can publish all of your events to the domain's endpoint. Event Grid makes sure each event is sent to the correct topic.
0 commit comments