Skip to content

Commit 3cffc00

Browse files
Merge pull request #289223 from spelluru/sendeventsmi1024
Event Grid basic -> Namespace topics
2 parents 56273d0 + 90d2ec0 commit 3cffc00

13 files changed

+105
-38
lines changed
Lines changed: 105 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,133 @@
11
---
22
title: How to send events to Event Grid namespace topics
33
description: This article describes how to deliver events to Event Grid namespace topics.
4-
ms.topic: conceptual
5-
ms.custom:
6-
- ignite-2023
7-
- build-2024
4+
ms.topic: how-to
85
ms.date: 11/15/2023
96
author: robece
107
ms.author: robece
8+
# Customer intent: I want to learn how to send forward events from an Event Grid topic to an Event Grid namespace topic
119
---
1210

1311
# How to send events from Event Grid basic to Event Grid namespace topics
1412

15-
This article describes how to forward events from event subscriptions created in resources like custom topics, system topics, domains, and partner topics to Event Grid namespaces.
13+
This article describes how to forward events from event subscriptions created in resources like topics, system topics, domains, and partner topics to Event Grid namespaces.
1614

17-
## Overview
18-
19-
Namespace topic as a destination in Event Grid basic event subscriptions that helps you to transition to Event Grid namespaces without modifying your existing workflow.
15+
Event Grid basic supports **Event Grid Namespace topic** as the **endpoint type**. When creating an event subscription to an Event Grid topic, system topic, domain, or partner topic, you can select an Event Grid namespace topic as the endpoint for handling events.
2016

2117
:::image type="content" source="media/handler-event-grid-namespace-topic/namespace-topic-handler-destination.png" alt-text="Image that shows events forwarded from Event Grid basic to Event Grid namespace topic." border="false" lightbox="media/handler-event-grid-namespace-topic/namespace-topic-handler-destination.png":::
2218

23-
Event Grid namespaces provides new, and interesting capabilities that you might be interested to use in your solutions. If you're currently using Event Grid basic resources like topics, system topics, domains, and partner topics you only need to create a new event subscription in your current topic and select Event Grid namespace topic as a handler destination.
19+
Namespace topic as a destination in Event Grid basic event subscriptions helps you with transitioning to Event Grid namespaces without modifying your existing workflow. Event Grid namespaces provide new and interesting capabilities that you might be interested to use in your solutions. If you're currently using Event Grid basic resources like topics, system topics, domains, and partner topics you only need to create a new event subscription in your current topic and select Event Grid namespace topic as a handler destination.
2420

25-
## How to forward events to a new Event Grid namespace
21+
This article covers an example scenario where you forward Azure Storage events to an Event Grid namespace. Here are the high-level steps:
2622

27-
Scenario: Subscribe to a storage account system topic and forward storage events to a new Event Grid namespace.
23+
1. Create a system topic for the Azure storage account and enable managed identity for the system topic.
24+
1. Assign the system topic's managed identity to the Event Grid Data Sender role on the destination Event Grid namespace.
25+
1. Create an event subscription to the system topic with the Event Grid namespace as the event handler, and use the managed identity for event delivery.
2826

29-
### Prerequisites
27+
## Prerequisites
3028

3129
1. Create an Event Grid namespace resource by following instructions from [Create, view, and manage namespaces](create-view-manage-namespaces.md).
3230
1. Create an Event Grid namespace topic by following instructions from [Create, view, and manage namespace topics](create-view-manage-namespace-topics.md).
33-
1. Create an Event Grid event subscription in a namespace topic by following instructions from [Create, view, and manage event subscriptions in namespace topics](create-view-manage-event-subscriptions.md).
31+
1. Create an Event Grid event subscription in a namespace topic by following instructions from [Create, view, and manage event subscriptions in namespace topics](create-view-manage-event-subscriptions.md). This step is optional, but it's useful for testing the scenario.
3432
1. Create an Azure storage account by following instructions from [create a storage account](blob-event-quickstart-portal.md#create-a-storage-account).
3533

36-
### Create and configure the event subscription
37-
38-
:::image type="content" source="media/handler-event-grid-namespace-topic/namespace-topic-subscription.png" alt-text="Screenshot that shows how to create a subscription to forward events from Event Grid basic to Event Grid namespace topic." border="false" lightbox="media/handler-event-grid-namespace-topic/namespace-topic-subscription.png":::
39-
40-
> [!NOTE]
41-
> For **Event Schema**, select the event schema as **Cloud Events Schema v1.0**. It's the only schema type that the Event Grid Namespace Topic destination supports.
42-
43-
Once the subscription is configured with the basic information, select the **Event Grid Namespace Topic** endpoint type in the endpoint details section and select **Configure an endpoint** to configure the endpoint.
44-
45-
You might want to use this article as a reference to explore how to [subscribe to the blob storage](blob-event-quickstart-portal.md#subscribe-to-the-blob-storage).
46-
47-
Steps to configure the endpoint:
48-
49-
1. On the **Select Event Grid Namespace Topic** page, follow these steps.
50-
1. Select the **subscription**.
51-
1. Select the **resource group**.
52-
1. Select the **Event Grid namespace** resource previously created.
53-
1. Select the **Event Grid namespace topic** where you want to forward the events.
54-
1. Select **Confirm Selection**.
55-
56-
:::image type="content" source="media/handler-event-grid-namespace-topic/namespace-topic-endpoint-configuration.png" alt-text="Screenshot that shows the Select Event Grid Namespace topic page to configure the endpoint to forward events from Event Grid basic to Event Grid namespace topic." border="false" lightbox="media/handler-event-grid-namespace-topic/namespace-topic-endpoint-configuration.png":::
57-
1. Now, on the **Create Event Subscription** page, select **Create** to create the event subscription.
58-
59-
## Next steps
34+
## Create a system topic and enable managed identity for the storage account
35+
If you have an existing system topic for the storage account, navigate to the system topic page. If you don't have one, create a system topic. Then, enable managed identity for the storage account.
36+
37+
1. Navigate to [Azure portal](https://portal.azure.com).
38+
1. In the search bar, search for **Event Grid System Topics**, and select it from the search results.
39+
1. On the **Event Grid System Topics** page, select **+ Create**.
40+
41+
:::image type="content" source="./media/handler-event-grid-namespace-topic/system-topics-page.png" alt-text="Screenshot that shows the System Topics page with the Create button selected." lightbox="./media/handler-event-grid-namespace-topic/system-topics-page.png":::
42+
1. On the **Create Event Grid System Topic** page, follow these steps:
43+
1. For **Topic Types**, select **Storage Accounts**.
44+
1. For **Subscription**, select the Azure subscription where you want to create the system topic.
45+
1. For **Resource Group**, select the resource group for the system topic.
46+
1. For **Resource**, select the Azure storage resource for which you want to create the system topic.
47+
1. In the **System Topic Details** section, for **Name**, enter a name for the topic.
48+
1. Select **Review + create** at the bottom of the page.
49+
50+
:::image type="content" source="./media/handler-event-grid-namespace-topic/create-system-topic-page.png" alt-text="Screenshot that shows the Create Event Grid System Topic page." lightbox="./media/handler-event-grid-namespace-topic/create-system-topic-page.png":::
51+
1. On the **Review + create** page, review settings, and select **Create**.
52+
53+
:::image type="content" source="./media/handler-event-grid-namespace-topic/create-system-topic-review-create.png" alt-text="Screenshot that shows the Create Event Grid System Topic - Review and create page." lightbox="./media/handler-event-grid-namespace-topic/create-system-topic-review-create.png":::
54+
1. After the deployment is successful, select **Go to resource** to navigate to the **Event Grid System Topic** page for the system topic you created.
55+
56+
### Enable managed identity for the system topic
57+
Now, enable managed identity for the system topic you created. For this example, let's create a system-assigned managed identity for the system topic.
58+
59+
1. On the **Event Grid System Topic** page, select **Identity** under **Settings** on the left navigation menu.
60+
1. On the **Identity** page, select **On** for **Status**.
61+
1. Select **Save** on the command bar.
62+
63+
:::image type="content" source="./media/handler-event-grid-namespace-topic/identity-page.png" alt-text="Screenshot that shows the Identity page for the system topic." lightbox="./media/handler-event-grid-namespace-topic/identity-page.png":::
64+
1. On the confirmation pop-up window, select **Yes** to confirm the creation of the managed identity.
65+
1. After the managed identity is created, you see the object (principal) ID for the identity.
66+
67+
Keep the **System Topic** page open in the current tab of your web browser.
68+
69+
## Grant the identity permission to send events to the namespace
70+
In the last step, you created a system-assigned managed identity for your storage account's system topic. In this step, you grant the identity the permission to send events to the target or destination namespace.
71+
72+
1. Launch a new tab or a window of the web browser. Navigate to your Event Grid namespace in the Azure portal.
73+
1. Select **Access control (IAM)** on the left menu.
74+
1. Select **Add** and then select **Add role assignment**.
75+
76+
:::image type="content" source="./media/handler-event-grid-namespace-topic/namespace-access-control-add.png" alt-text="Screenshot that shows the Access control page for the Event Grid namespace." lightbox="./media/handler-event-grid-namespace-topic/namespace-access-control-add.png":::
77+
1. On the **Role** page, search for and select **Event Grid Data Sender** role, and then select **Next**.
78+
79+
:::image type="content" source="./media/handler-event-grid-namespace-topic/role-page.png" alt-text="Screenshot that shows the Access control page with Event Grid Data Sender role selected." lightbox="./media/handler-event-grid-namespace-topic/role-page.png":::
80+
1. On the **Members** page, for **Assign access to**, select **Managed identity**, and then choose **+ Select members**.
81+
82+
:::image type="content" source="./media/handler-event-grid-namespace-topic/members-page.png" alt-text="Screenshot that shows the Members page." lightbox="./media/handler-event-grid-namespace-topic/members-page.png":::
83+
1. On the **Select managed identities** page, follow these steps:
84+
1. For **Subscription**, select the Azure subscription where the managed identity is created.
85+
1. For **Managed identity**, select **Event Grid System Topic**.
86+
1. For **Select**, type the name of your system topic.
87+
1. In the search results, select the managed identity. The managed identity's name is same as the system topic's name.
88+
89+
:::image type="content" source="./media/handler-event-grid-namespace-topic/select-identity.png" alt-text="Screenshot that shows the selection of a managed identity." lightbox="./media/handler-event-grid-namespace-topic/select-identity.png":::
90+
1. On the **Members** page, select **Next**.
91+
1. On the **Review + assign** page, review settings, and select **Review + assign** at the bottom of the page.
92+
93+
94+
## Create an event subscription to the storage system topic
95+
Now, you're ready to create an event subscription to the system topic for the source storage account using the namespace as an endpoint.
96+
97+
1. On the **System Topic** page for the system topic, select **Overview** on the left menu if it's not already selected.
98+
1. Select **+ Event Subscription** on the command bar.
99+
100+
:::image type="content" source="media/handler-event-grid-namespace-topic/create-event-subscription-button.png" alt-text="Screenshot that shows the Event Grid System Topic page with the Event Subscription button selected." border="false" lightbox="media/handler-event-grid-namespace-topic/create-event-subscription-button.png":::
101+
1. On the **Create Event Subscription** page, follow these steps:
102+
1. For **Name**, enter the name for an event subscription.
103+
1. For **Event Schema**, select the event schema as **Cloud Events Schema v1.0**. It's the only schema type that the Event Grid Namespace Topic destination supports.
104+
1. For **Filter to Event Types**, select types of events you want to subscribe too.
105+
1. For **Endpoint type**, select **Event Grid Namespace Topic**.
106+
1. Select **Configure an endpoint**.
107+
108+
:::image type="content" source="media/handler-event-grid-namespace-topic/select-configure-endpoint.png" alt-text="Screenshot that shows the Create Event Subscription page with Configure an endpoint selected." border="false" lightbox="media/handler-event-grid-namespace-topic/select-configure-endpoint.png":::
109+
1. On the **Select Event Grid Namespace Topic** page, follow these steps:
110+
1. For **Subscription**, select the Azure subscription, resource group, and the namespace that has the namespace topic.
111+
1. For **Event Grid namespace topic**, select the namespace topic.
112+
1. Select **Confirm selection** at the bottom of the page.
113+
1. Now, on the **Create Event Subscription** page, for **Managed identity type**, select **System assigned**.
114+
1. Select **Create** at the bottom of the page.
115+
116+
:::image type="content" source="media/handler-event-grid-namespace-topic/namespace-topic-subscription.png" alt-text="Screenshot that shows how to create a subscription to forward events from Event Grid basic to Event Grid namespace topic." border="false" lightbox="media/handler-event-grid-namespace-topic/namespace-topic-subscription.png":::
117+
118+
To test the scenario, create a container in the Azure blob storage and upload a file to it. Verify that the event handler or endpoint for your namespace topic receives the blob created event.
119+
120+
When you upload a blob to a container in the Azure storage, here's what happens:
121+
122+
1. Azure Blob Storage sends a **Blob Created** event to your blob storage's system topic.
123+
1. The event is forwarded to your namespace topic as it's the event handler or endpoint for the system topic.
124+
1. The endpoint for the subscription to the namespace topic receives the forwarded event.
125+
126+
127+
## Related content
60128

61129
See the following articles:
62130

63131
- [Pull delivery overview](pull-delivery-overview.md)
64132
- [Push delivery overview](push-delivery-overview.md)
65-
- [Concepts](concepts.md)
66133
- Quickstart: [Publish and subscribe to app events using namespace topics](publish-events-using-namespace-topics.md)
24.9 KB
Loading
43.2 KB
Loading
33.7 KB
Loading
43.8 KB
Loading
27.6 KB
Loading
45.2 KB
Loading
-77.5 KB
Loading
59.8 KB
Loading

0 commit comments

Comments
 (0)