Skip to content

Commit bd8cb44

Browse files
committed
SFI: Removed hardcoded GUIDs and added steps
1 parent b8b757f commit bd8cb44

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed
63.4 KB
Loading

articles/event-grid/scripts/powershell-webhook-secure-delivery-microsoft-entra-app.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,25 @@ Here are the high level steps from the script:
1919
1. Add service principal of event subscription writer Microsoft Entra app to the AzureEventGridSecureWebhookSubscriber role
2020
1. Add service principal of Microsoft.EventGrid to the AzureEventGridSecureWebhookSubscriber role as well
2121

22+
## Get Microsoft.EventGrid application ID
23+
24+
1. Navigate to [Azure portal](https://portal.azure.com).
25+
1. In the search bar, type `Microsoft.EventGrid`, and then select **Microsoft.EventGrid (Service Principal)** in the drop-down list.
26+
27+
:::image type="content" source="../media/event-grid-app-id/select-microsoft-event-grid.png" alt-text="Screenshot that shows the selection of Microsoft Event Grid from the drop-down list.":::
28+
1. On the **Microsoft.EventGrid** page, note down or copy the **Application ID** to the clipboard.
29+
1. In the following script, set the `$eventGridAppId` variable to this value before running it.
30+
2231
## Sample script - stable
2332

2433
```azurepowershell
2534
# NOTE: Before run this script ensure you are logged in Azure by using "az login" command.
2635
36+
$eventGridAppId = "[REPLACE_WITH_EVENT_GRID_APP_ID]"
2737
$webhookAppObjectId = "[REPLACE_WITH_YOUR_ID]"
2838
$eventSubscriptionWriterAppId = "[REPLACE_WITH_YOUR_ID]"
2939
40+
3041
# Start execution
3142
try {
3243
@@ -51,8 +62,6 @@ try {
5162
# You don't need to modify this id
5263
# But Azure Event Grid Entra Application Id is different for different clouds
5364
54-
$eventGridAppId = "4962773b-9cdb-44cf-a8bf-237846a00ab7" # Azure Public Cloud
55-
# $eventGridAppId = "54316b56-3481-47f9-8f30-0300f5542a7b" # Azure Government Cloud
5665
$eventGridSP = Get-MgServicePrincipal -Filter ("appId eq '" + $eventGridAppId + "'")
5766
if ($eventGridSP.DisplayName -match "Microsoft.EventGrid")
5867
{

articles/event-grid/scripts/powershell-webhook-secure-delivery-microsoft-entra-user.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@ Here are the high level steps from the script:
1818
1. Add service principal of user who is creating the subscription to the AzureEventGridSecureWebhookSubscriber role.
1919
1. Add service principal of Microsoft.EventGrid to the AzureEventGridSecureWebhookSubscriber.
2020

21+
## Get Microsoft.EventGrid application ID
22+
23+
1. Navigate to [Azure portal](https://portal.azure.com).
24+
1. In the search bar, type `Microsoft.EventGrid`, and then select **Microsoft.EventGrid (Service Principal)** in the drop-down list.
25+
26+
:::image type="content" source="../media/event-grid-app-id/select-microsoft-event-grid.png" alt-text="Screenshot that shows the selection of Microsoft Event Grid from the drop-down list.":::
27+
1. On the **Microsoft.EventGrid** page, note down or copy the **Application ID** to the clipboard.
28+
1. In the following script, set the `$eventGridAppId` variable to this value before running it.
29+
30+
2131
## Sample script
2232

2333
```azurepowershell
2434
# NOTE: Before run this script ensure you are logged in Azure by using "az login" command.
2535
36+
$eventGridAppId = "[REPLACE_WITH_EVENT_GRID_APP_ID]"
2637
$webhookAppObjectId = "[REPLACE_WITH_YOUR_ID]"
2738
$eventSubscriptionWriterUserPrincipalName = "[REPLACE_WITH_USER_PRINCIPAL_NAME_OF_THE_USER_WHO_WILL_CREATE_THE_SUBSCRIPTION]"
2839
@@ -50,8 +61,6 @@ try {
5061
# You don't need to modify this id
5162
# But Azure Event Grid Microsoft Entra Application Id is different for different clouds
5263
53-
$eventGridAppId = "4962773b-9cdb-44cf-a8bf-237846a00ab7" # Azure Public Cloud
54-
# $eventGridAppId = "54316b56-3481-47f9-8f30-0300f5542a7b" # Azure Government Cloud
5564
$eventGridSP = Get-MgServicePrincipal -Filter ("appId eq '" + $eventGridAppId + "'")
5665
if ($eventGridSP.DisplayName -match "Microsoft.EventGrid")
5766
{

0 commit comments

Comments
 (0)