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/managed-service-identity.md
+16-18Lines changed: 16 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
---
2
2
title: Event delivery, managed service identity, and private link
3
-
description: This article describes how to enable managed service identity for an Azure event grid topic. Use it to forward events to supported destinations.
3
+
description: This article describes how to enable managed service identity for an Azure Event Grid topic. Use it to forward events to supported destinations.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-azurecli
6
-
ms.date: 03/25/2021
6
+
ms.date: 12/12/2023
7
7
---
8
8
9
9
# Event delivery with a managed identity
10
-
This article describes how to use a [managed service identity](/entra/identity/managed-identities-azure-resources/overview) for an Azure event grid system topic, custom topic, or domain. Use it to forward events to supported destinations such as Service Bus queues and topics, event hubs, and storage accounts.
11
-
10
+
This article describes how to use a [managed service identity](/entra/identity/managed-identities-azure-resources/overview) for an Azure Event Grid system topic, custom topic, or domain. Use it to forward events to supported destinations such as Service Bus queues and topics, event hubs, and storage accounts.
12
11
13
12
14
13
## Prerequisites
@@ -21,27 +20,26 @@ This article describes how to use a [managed service identity](/entra/identity/m
21
20
> Currently, it's not possible to deliver events using [private endpoints](../private-link/private-endpoint-overview.md). For more information, see the [Private endpoints](#private-endpoints) section at the end of this article.
22
21
23
22
## Create event subscriptions that use an identity
24
-
After you have an event grid custom topic or system topic or domain with a system-managed identity and have added the identity to the appropriate role on the destination, you're ready to create subscriptions that use the identity.
23
+
After you have an Event Grid custom topic or system topic or domain with a managed identity and have added the identity to the appropriate role on the destination, you're ready to create subscriptions that use the identity.
25
24
26
25
### Use the Azure portal
27
26
When you create an event subscription, you see an option to enable the use of a system-assigned identity or user-assigned identity for an endpoint in the **ENDPOINT DETAILS** section.
28
27
29
28
Here's an example of enabling system-assigned identity while creating an event subscription with a Service Bus queue as a destination.
30
29
31
-

30
+
:::image type="content" source="./media/managed-service-identity/service-bus-queue-subscription-identity.png" alt-text="Screenshot that shows how to enable an identity when creating an event subscription for a Service Bus queue.":::
32
31
33
32
You can also enable using a system-assigned identity to be used for dead-lettering on the **Additional Features** tab.
34
33
35
-

36
-
37
-
You can also enable a managed identity on an event subscription after it's created. On the **Event Subscription** page for the event subscription, switch to the **Additional Features** tab to see the option.
34
+

38
35
39
-

36
+
You can enable a managed identity on an event subscription after it's created. On the **Event Subscription** page for the event subscription, switch to the **Additional Features** tab to see the option. You can also enable identity for dead-lettering on this page.
40
37
41
-
If you had enabled user-assigned identities for the topic, you will see user-assigned identity option enabled in the drop-down list for **Manged Identity Type**. If you select **User Assigned** for **Managed Identity Type**, you can then select the user-assigned identity that you want to use to deliver events.
38
+
:::image type="content" source="./media/managed-service-identity/event-subscription-additional-features.png" alt-text="Screenshot that shows how to enable a system-assigned identity on an existing event subscription.":::
42
39
43
-

40
+
If you had enabled user-assigned identities for the topic, you'll see user-assigned identity option enabled in the drop-down list for **Manged Identity Type**. If you select **User Assigned** for **Managed Identity Type**, you can then select the user-assigned identity that you want to use to deliver events.
44
41
42
+
:::image type="content" source="./media/managed-service-identity/event-subscription-user-identity.png" alt-text="Screenshot that shows how to enable a user-assigned identity on an event subscription.":::
45
43
46
44
### Use the Azure CLI - Service Bus queue
47
45
In this section, you learn how to use the Azure CLI to enable the use of a system-assigned identity to deliver events to a Service Bus queue. The identity must be a member of the **Azure Service Bus Data Sender** role. It must also be a member of the **Storage Blob Data Contributor** role on the storage account that's used for dead-lettering.
@@ -60,7 +58,7 @@ sb_esname = "<Specify a name for the event subscription>"
60
58
```
61
59
62
60
#### Create an event subscription by using a managed identity for delivery
63
-
This sample command creates an event subscription for an event grid custom topic with an endpoint type set to **Service Bus queue**.
61
+
This sample command creates an event subscription for an Event Grid custom topic with an endpoint type set to **Service Bus queue**.
64
62
65
63
```azurecli-interactive
66
64
az eventgrid event-subscription create
@@ -72,7 +70,7 @@ az eventgrid event-subscription create
72
70
```
73
71
74
72
#### Create an event subscription by using a managed identity for delivery and dead-lettering
75
-
This sample command creates an event subscription for an event grid custom topic with an endpoint type set to **Service Bus queue**. It also specifies that the system-managed identity is to be used for dead-lettering.
73
+
This sample command creates an event subscription for an Event Grid custom topic with an endpoint type set to **Service Bus queue**. It also specifies that the system-managed identity is to be used for dead-lettering.
76
74
77
75
```azurecli-interactive
78
76
storageid=$(az storage account show --name demoStorage --resource-group gridResourceGroup --query id --output tsv)
#### Create an event subscription by using a managed identity for delivery
105
-
This sample command creates an event subscription for an event grid custom topic with an endpoint type set to **Event Hubs**.
103
+
This sample command creates an event subscription for an Event Grid custom topic with an endpoint type set to **Event Hubs**.
106
104
107
105
```azurecli-interactive
108
106
az eventgrid event-subscription create
@@ -114,7 +112,7 @@ az eventgrid event-subscription create
114
112
```
115
113
116
114
#### Create an event subscription by using a managed identity for delivery + deadletter
117
-
This sample command creates an event subscription for an event grid custom topic with an endpoint type set to **Event Hubs**. It also specifies that the system-managed identity is to be used for dead-lettering.
115
+
This sample command creates an event subscription for an Event Grid custom topic with an endpoint type set to **Event Hubs**. It also specifies that the system-managed identity is to be used for dead-lettering.
118
116
119
117
```azurecli-interactive
120
118
storageid=$(az storage account show --name demoStorage --resource-group gridResourceGroup --query id --output tsv)
@@ -177,9 +175,9 @@ az eventgrid event-subscription create
177
175
```
178
176
179
177
## Private endpoints
180
-
Currently, it's not possible to deliver events using [private endpoints](../private-link/private-endpoint-overview.md). That is, there is no support if you have strict network isolation requirements where your delivered events traffic must not leave the private IP space.
178
+
Currently, it's not possible to deliver events using [private endpoints](../private-link/private-endpoint-overview.md). That is, there's no support if you have strict network isolation requirements where your delivered events traffic must not leave the private IP space.
181
179
182
-
However, if your requirements call for a secure way to send events using an encrypted channel and a known identity of the sender (in this case, Event Grid) using public IP space, you could deliver events to Event Hubs, Service Bus, or Azure Storage service using an Azure event grid custom topic or a domain with system-managed identity configured as shown in this article. Then, you can use a private link configured in Azure Functions or your webhook deployed on your virtual network to pull events. See the tutorial: [Connect to private endpoints with Azure Functions](../azure-functions/functions-create-vnet.md).
180
+
However, if your requirements call for a secure way to send events using an encrypted channel and a known identity of the sender (in this case, Event Grid) using public IP space, you could deliver events to Event Hubs, Service Bus, or Azure Storage service using an Azure Event Grid custom topic or a domain with a managed identity as shown in this article. Then, you can use a private link configured in Azure Functions or your webhook deployed on your virtual network to pull events. See the tutorial: [Connect to private endpoints with Azure Functions](../azure-functions/functions-create-vnet.md).
183
181
184
182
Under this configuration, the traffic goes over the public IP/internet from Event Grid to Event Hubs, Service Bus, or Azure Storage, but the channel can be encrypted and a managed identity of Event Grid is used. If you configure your Azure Functions or webhook deployed to your virtual network to use an Event Hubs, Service Bus, or Azure Storage via private link, that section of the traffic will evidently stay within Azure.
0 commit comments