Skip to content

Commit 6bf4d14

Browse files
committed
separated steps for Tenant A & B
1 parent bdacd46 commit 6bf4d14

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

articles/event-grid/secure-webhook-delivery.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -111,60 +111,66 @@ Based on the diagram above, follow the next steps to configure the tenant.
111111

112112
## Deliver events to a Webhook in a different Azure AD tenant
113113

114-
To enable a secure webhook subscription across multiple tenants you'll need to do this task by using an Azure AD Application, this process isn't currently available by using the Azure AD user from the portal.
114+
To secure the connection between your event subscription and your webhook endpoint that are in different Azure AD tenants, you'll need to use an Azure AD application as shown in this section. Currently, it's not possible to secure this connection by using an Azure AD user in the Azure portal.
115115

116116
![Multitenant events with Azure AD and Webhooks](./media/secure-webhook-delivery/multitenant-diagram.png)
117117

118-
Based on the diagram above, follow the next steps to configure both tenants.
118+
Based on the diagram above, follow next steps to configure both tenants.
119119

120-
1. Create an Azure AD Application for the Event Grid subscription writer configured to work with any Azure AD directory (Multitenant) in the **Tenant A**.
120+
### Tenant A
121121

122-
2. Create a secret for the Azure AD Application previously created in the **Tenant A** and save the value (you'll need this value later).
122+
Do the following steps in **Tenant A**:
123123

124-
3. In the **Tenant A**, go to the Access control (IAM) in the Event Grid Topic and add the role assignment of the Azure AD Application of the Event Grid subscription writer as Event Grid Contributor, this step will allow us to have access to the Event Grid resource when we logged-in into Azure with the Azure AD Application by using the Azure CLI.
124+
1. Create an Azure AD application for the Event Grid subscription writer configured to work with any Azure AD directory (Multitenant).
125125

126-
4. Create an Azure AD Application for the webhook configured to work with the Microsoft directory (Single tenant) in the **Tenant B**.
126+
2. Create a secret for the Azure AD application previously created in the **Tenant A**, and save the value (you'll need this value later).
127127
128-
5. Open the [Azure Shell](https://portal.azure.com/#cloudshell/) in the **Tenant B** and select the PowerShell environment.
128+
3. Navigate to the **Access control (IAM)** page for the event grid topic. Add Azure AD application of the Event Grid subscription writer to the **Event Grid Contributor** role. This step allows the application to have access to the Event Grid resource when you log in into Azure with the Azure AD application by using the Azure CLI.
129129
130-
6. Modify the **$webhookAadTenantId** value to connect to the **Tenant B**.
130+
### Tenant B
131+
132+
Do the following steps in **Tenant B**:
131133
134+
1. Create an Azure AD Application for the webhook configured to work with the Microsoft directory (Single tenant).
135+
5. Open the [Azure Shell](https://portal.azure.com/#cloudshell/), and select the PowerShell environment.
136+
6. Modify the **$webhookAadTenantId** value to connect to the **Tenant B**.
132137
- Variables:
133138
- **$webhookAadTenantId**: Azure Tenant ID for the **Tenant B**
134139
135-
```Shell
136-
PS /home/user>$webhookAadTenantId = "[REPLACE_WITH_YOUR_TENANT_ID]"
137-
PS /home/user>Connect-AzureAD -TenantId $webhookAadTenantId
138-
```
139-
140-
7. Open the [following script](scripts/event-grid-powershell-webhook-secure-delivery-azure-ad-app.md) and update the values of **$webhookAppObjectId** and **$eventSubscriptionWriterAppId** with your identifiers, then continue to run the script.
140+
```Shell
141+
PS /home/user>$webhookAadTenantId = "[REPLACE_WITH_YOUR_TENANT_ID]"
142+
PS /home/user>Connect-AzureAD -TenantId $webhookAadTenantId
143+
```
144+
7. Open the [following script](scripts/event-grid-powershell-webhook-secure-delivery-azure-ad-app.md), and update values of **$webhookAppObjectId** and **$eventSubscriptionWriterAppId** with your identifiers, then continue to run the script.
141145
142146
- Variables:
143-
- **$webhookAppObjectId**: Azure AD Application ID created for the webhook
144-
- **$eventSubscriptionWriterAppId**: Azure AD Application ID for Event Grid subscription writer
147+
- **$webhookAppObjectId**: Azure AD application ID created for the webhook
148+
- **$eventSubscriptionWriterAppId**: Azure AD application ID for Event Grid subscription writer
145149
146-
> [!NOTE]
147-
> You don't need to modify the value of **```$eventGridAppId```**, for this script we set **AzureEventGridSecureWebhookSubscriber** as the value for the **```$eventGridRoleName```**. Remember, you must be a member of the [Azure AD Application Administrator role](../active-directory/roles/permissions-reference.md#all-roles) to execute this script.
150+
> [!NOTE]
151+
> You don't need to modify the value of **```$eventGridAppId```**, for this script we set **AzureEventGridSecureWebhookSubscriber** as the value for the **```$eventGridRoleName```**. Remember, you must be a member of the [Azure AD Application Administrator role](../active-directory/roles/permissions-reference.md#all-roles) to execute this script.
148152

149-
8. Open the [Azure Shell](https://portal.azure.com/#cloudshell/) in the **Tenant A** and login as the Event Grid subscription writer Azure AD Application by running the command.
153+
### Tenant A
154+
155+
Back in **Tenant A**, do the following steps:
156+
157+
1. Open the [Azure Shell](https://portal.azure.com/#cloudshell/), and login as the Event Grid subscription writer Azure AD Application by running the command.
150158

151159
```Shell
152160
PS /home/user>az login --service-principal -u [REPLACE_WITH_APP_ID] -p [REPLACE_WITH_SECRET_VALUE] --tenant [REPLACE_WITH_TENANT_ID]
153161
```
154-
155-
9. Create your subscription by running the command.
162+
2. Create your subscription by running the command.
156163

157164
```Shell
158165
PS /home/user>az eventgrid system-topic event-subscription create --name [REPLACE_WITH_SUBSCRIPTION_NAME] -g [REPLACE_WITH_RESOURCE_GROUP] --system-topic-name [REPLACE_WITH_SYSTEM_TOPIC] --endpoint [REPLACE_WITH_WEBHOOK_ENDPOINT] --event-delivery-schema [REPLACE_WITH_WEBHOOK_EVENT_SCHEMA] --azure-active-directory-tenant-id [REPLACE_WITH_TENANT_B_ID] --azure-active-directory-application-id-or-uri [REPLACE_WITH_APPLICATION_ID_FROM_SCRIPT] --endpoint-type webhook
159166
```
160167

161168
> [!NOTE]
162-
> In this scenario we are using an Event Grid System Topic. See [here](/cli/azure/eventgrid), if you want to create a subscription for Custom Topics or Event Grid Domains by using the Azure CLI.
163-
164-
10. If everything was correctly configured, you can successfully create the webhook subscription in your Event Grid Topic.
169+
> In this scenario we are using an Event Grid System Topic. See [here](/cli/azure/eventgrid), if you want to create a subscription for custom topics or Event Grid domains by using the Azure CLI.
170+
3. If everything was correctly configured, you can successfully create the webhook subscription in your event grid topic.
165171

166172
> [!NOTE]
167-
> At this point Event Grid is now passing the Azure AD Bearer token to the webhook client in every message, you'll need to validate the Authorization token in your webhook.
173+
> At this point, Event Grid is now passing the Azure AD Bearer token to the webhook client in every message. You'll need to validate the Authorization token in your webhook.
168174
169175
## Next steps
170176

0 commit comments

Comments
 (0)