Skip to content

Commit 3996a76

Browse files
committed
Addressing PR comments
1 parent e69ebe6 commit 3996a76

12 files changed

+90
-89
lines changed

articles/communication-services/quickstarts/events/includes/create-eventsubscription-az-cli.md renamed to articles/communication-services/quickstarts/events/includes/create-event-subscription-az-cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: pgrandhi
1717

1818
[!INCLUDE [register-provider-cli.md](register-provider-cli.md)]
1919

20-
## Create Event Subscription
20+
## Create event subscription
2121

2222
To create event subscriptions for Azure Communication Services resource, [sign in to Azure CLI](/cli/azure/authenticate-azure-cli). You can sign in running the ```az login``` command from the terminal and providing your credentials. Run the following command to create the event subscription for the resource:
2323

@@ -34,7 +34,7 @@ az eventgrid event-subscription create
3434

3535
For a list of Communication Services events, see [Communication Services Events](../../../../../articles/event-grid/event-schema-communication-services.md).
3636

37-
## List Event Subscriptions
37+
## List event subscriptions
3838

3939
To list all the existing event subscriptions set up for an Azure Communication Services resource, by using [the Azure CLI](/cli/azure/get-started-with-azure-cli), use the [`az eventgrid event-subscription list`](/cli/azure/eventgrid/event-subscription#az-eventgrid-event-subscription-list) command.
4040

@@ -47,7 +47,7 @@ az eventgrid event-subscription update
4747
--endpoint https://azureeventgridviewer.azurewebsites.net/api/updates
4848
```
4949

50-
## Update Event Subscription
50+
## Update event subscription
5151

5252
To update an existing event subscription by using [the Azure CLI](/cli/azure/get-started-with-azure-cli), use the [`az eventgrid event-subscription update`](/cli/azure/eventgrid/event-subscription#az-eventgrid-event-subscription-update) command.
5353

@@ -56,7 +56,7 @@ az eventgrid event-subscription list
5656
--source-resource-id /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Communication/CommunicationServices/<acsResourceName>
5757
```
5858

59-
## Delete Event Subscription
59+
## Delete event subscription
6060

6161
To delete an existing event subscription by using [the Azure CLI](/cli/azure/get-started-with-azure-cli), use the [`az eventgrid event-subscription delete`](/cli/azure/eventgrid/event-subscription#az-eventgrid-event-subscription-delete) command.
6262

articles/communication-services/quickstarts/events/includes/create-eventsubscription-azp.md renamed to articles/communication-services/quickstarts/events/includes/create-event-subscription-azp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: pgrandhi
1414

1515
[!INCLUDE [register-event-grid-resource-provider.md](register-event-grid-resource-provider.md)]
1616

17-
## Create Event Subscription
17+
## Create event subscription
1818

1919
To create an Event subscription for Azure Communication Services, use the following steps. This article shows how to create an Event subscription for Azure Communication Services to receive events via Webhook.
2020

@@ -43,7 +43,7 @@ For more information on Communication Services events, see [Communication Servic
4343

4444
1. Enter the link to the webhook and Select **Confirm Selection**.
4545

46-
:::image type="content" source="../media/subscribe-through-portal/select-webhook-endpoint.png" alt-text="Screenshot highlighting the select webhook endpoint page in the Azure portal." lightbox="../media/subscribe-through-portal/select-webhook-endpoint.png":::
46+
:::image type="content" source="../media/subscribe-through-portal/select-web-hook-endpoint.png" alt-text="Screenshot highlighting the select webhook endpoint page in the Azure portal." lightbox="../media/subscribe-through-portal/select-webhook-endpoint.png":::
4747

4848
1. In the **Filters** tab, add the names of the event types you want to filter in the subscription and add context attribute filters you want to use in the subscription. Then, select **Next: Additional features** at the bottom of the page.
4949

@@ -56,7 +56,7 @@ For more information on Communication Services events, see [Communication Servic
5656
1. When done, select **Create**.
5757

5858

59-
## Update Event Subscription
59+
## Update event subscription
6060

6161
To update an Event subscription for Azure Communication Services, use the following steps. This section shows how to update an Event subscription for Azure Communication Services to update the events you want to receive via Webhook.
6262

@@ -76,12 +76,12 @@ To update an Event subscription for Azure Communication Services resource, first
7676
:::image type="content" source="../media/subscribe-through-portal/select-additional-features.png" alt-text="Screenshot that shows the Additional features tab of the Update Event Subscription page." lightbox="../media/subscribe-through-portal/select-additional-features.png":::
7777

7878
1. To update the webhook to receive events, select on **Change** next to the webhook link and enter the new webhook endpoint.
79-
:::image type="content" source="../media/subscribe-through-portal/update-webhook-endpoint.png" alt-text="Screenshot that shows the Change the webhook endpoint link in the Event Subscription page." lightbox="../media/subscribe-through-portal/update-webhook-endpoint.png":::
79+
:::image type="content" source="../media/subscribe-through-portal/update-web-hook-endpoint.png" alt-text="Screenshot that shows the Change the webhook endpoint link in the Event Subscription page." lightbox="../media/subscribe-through-portal/update-webhook-endpoint.png":::
8080

8181
1. When done, select **Save**,
8282
:::image type="content" source="../media/subscribe-through-portal/save-update.png" alt-text="Screenshot that shows the save button in the Azure portal." lightbox="../media/subscribe-through-portal/update-webhook-endpoint.png":::
8383

84-
## Delete Event Subscription
84+
## Delete event subscription
8585

8686
To delete an Event subscription for Azure Communication Services, use the following steps.
8787

articles/communication-services/quickstarts/events/includes/create-eventsubscription-net.md renamed to articles/communication-services/quickstarts/events/includes/create-event-subscription-net.md

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ ms.author: pgrandhi
1010

1111
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet/).
1212
- The latest version [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core) for your operating system.
13-
- Get the latest version of the [.NET Microsoft Azure EventGrid Management SDK](/azure/event-grid/sdk-overview).
14-
- Setup a way to authenticate to Azure with [Azure Identity](/dotnet/api/overview/azure/identity-readme) library as described below.
13+
- Get the latest version of the [.NET Microsoft Azure Event Grid Management SDK](/azure/event-grid/sdk-overview).
14+
- Get the latest version of the [Azure Identity](/dotnet/api/overview/azure/identity-readme) library.
1515
- An [Azure Communication Services resource](../../create-communication-resource.md).
1616

1717
[!INCLUDE [register-event-grid-resource-provider.md](register-event-grid-resource-provider.md)]
@@ -23,7 +23,7 @@ First, install the Microsoft Azure Event Grid Management library for .NET with [
2323
```csharp
2424
dotnet add package Azure.ResourceManager.EventGrid;
2525
```
26-
1. Include the Communication Services Management SDK in your C# project:
26+
Include the Event Grid Management SDK in your C# project:
2727

2828
```csharp
2929
using Microsoft.Azure.Management.EventGrid;
@@ -33,12 +33,12 @@ using Microsoft.Azure.Management.EventGrid.Models;
3333
## Authenticating with Azure Identity library
3434

3535
### Prerequisites:
36-
1. Create a Microsoft Entra application and Service Principal that can access the resources in your subscription by following the instructions [here](/entra/identity-platform/howto-create-service-principal-portal).
37-
2. Create a new Client secret or upload a trusted certificate issued by a certificate authority following the instructions above. This secret or certificate should be stored in the Keyvault.
38-
3. Give contributor or owner access to the subscription to that application following the instructions [here](/azure/role-based-access-control/quickstart-assign-role-user-portal).
39-
4. Read more about authorizing access to Event Grid resources [here](/azure/event-grid/security-authorization).
36+
1. Create a Microsoft Entra application and Service Principal and set up a client secret or trusted certificate issued by certificate authority by following the instructions [here](/entra/identity-platform/howto-create-service-principal-portal).
37+
1. Store the secret or the certificate in the Azure Keyvault.
38+
1. Give contributor or owner access to the subscription to that application following the instructions [here](/azure/role-based-access-control/quickstart-assign-role-user-portal).
39+
1. Read more about authorizing access to Event Grid resources [here](/azure/event-grid/security-authorization).
4040

41-
The Azure Identity library provides Microsoft Entra ID (Formerly Azure Active Directory) token authentication support across the Azure SDK. It provides a set of TokenCredential implementations which can be used to construct Azure SDK clients which support Microsoft Entra token authentication. You can read more about it [here](/dotnet/api/overview/azure/identity-readme).
41+
The Azure Identity library provides Microsoft Entra ID (Formerly Azure Active Directory) token authentication support across the Azure SDK. It provides a set of TokenCredential implementations, which can be used to construct Azure SDK clients that support Microsoft Entra token authentication. You can read more about it [here](/dotnet/api/overview/azure/identity-readme).
4242

4343
1. Include the Azure Identity client library for .NET with [NuGet](https://www.nuget.org/):
4444

@@ -55,58 +55,57 @@ using Azure.Security.KeyVault.Secrets
5555

5656
3. You can either pass the secret credentials or certificate credentials to get access token, based on how your Service Principal is configured.
5757

58-
a. Get Access token using secret credential
59-
60-
To get the secret credentials, you will need to read it from the Keyvault you created in Prerequisite #2 using [SecretClient](/azure/key-vault/secrets/quick-create-net).
61-
62-
```csharp
63-
// Authenticate the Keyvault client with DefaultAzureCredential and get the secret.
64-
SecretClient secretClient = new SecretClient(new Uri("https://myvault.vault.azure.net/"), new DefaultAzureCredential());
65-
string clientSecret = await secretClient.GetSecretAsync(secretName).Value;
66-
67-
// Get access token using secret credentials
68-
string[] scopes = { "https://management.azure.com/.default" };
69-
var application = ConfidentialClientApplicationBuilder
70-
.Create('your-servicePrincipal-appId')
71-
.WithAuthority(authorityUri: new Uri(authority), validateAuthority: true)
72-
.WithTenantId('your-tenant_id')
73-
.WithClientSecret(clientSecret)
74-
.Build();
75-
76-
var token = await application
77-
.AcquireTokenForClient(scopes)
78-
.ExecuteAsync();
79-
```
80-
81-
82-
b. Get Access token using certificate credential
83-
84-
To get the secret credentials, you will need to read it from the Keyvault you created in Prerequisite #2 using [CertificateClient](/azure/key-vault/certificates/quick-create-net).
85-
86-
Read more about the Microsoft Entra Application configuration Authority [here](/entra/identity-platform/msal-client-application-configuration)
87-
88-
```csharp
89-
// Authenticate the certificate client with DefaultAzureCredential and get the certificate.
90-
CertificateClient certificateClient = new SecretClient(new Uri("https://myvault.vault.azure.net/"), new DefaultAzureCredential());
91-
X509Certificat2 cert = await certificateClient.DownloadCertificateAsync(certificateName);
92-
93-
// Get access token using certificate credentials
94-
string[] scopes = { "https://management.azure.com/.default" };
95-
string authority = "https://login.microsoftonline.com/<tenant>/";
96-
var application = ConfidentialClientApplicationBuilder
97-
.Create('<servicePrincipal-appId>')
98-
.WithAuthority(authorityUri: new Uri(authority), validateAuthority: true)
99-
.WithTenantId("<tenantId>")
100-
.WithCertificate(cert)
101-
.Build();
102-
103-
var token = await application
104-
.AcquireTokenForClient(scopes)
105-
.WithSendX5C(true)
106-
.ExecuteAsync();
107-
```
108-
109-
4. Authenticate EventGridManagementClient with Acess Token using SecretCredential or CertificateCredential
58+
* Get access token using secret credential
59+
60+
To get the secret credentials, you need to read it from the Keyvault you created in Prerequisite #2 using [SecretClient](/azure/key-vault/secrets/quick-create-net).
61+
62+
```csharp
63+
// Authenticate the Keyvault client with DefaultAzureCredential and get the secret.
64+
SecretClient secretClient = new SecretClient(new Uri("https://myvault.vault.azure.net/"), new DefaultAzureCredential());
65+
string clientSecret = await secretClient.GetSecretAsync(secretName).Value;
66+
67+
// Get access token using secret credentials
68+
string[] scopes = { "https://management.azure.com/.default" };
69+
var application = ConfidentialClientApplicationBuilder
70+
.Create('your-servicePrincipal-appId')
71+
.WithAuthority(authorityUri: new Uri(authority), validateAuthority: true)
72+
.WithTenantId('your-tenant_id')
73+
.WithClientSecret(clientSecret)
74+
.Build();
75+
76+
var token = await application
77+
.AcquireTokenForClient(scopes)
78+
.ExecuteAsync();
79+
```
80+
81+
* Get access token using certificate credential
82+
83+
To get the certificate credentials, you need to read it from the Keyvault you created in Prerequisite #2 using [CertificateClient](/azure/key-vault/certificates/quick-create-net).
84+
85+
Read more about the Microsoft Entra application configuration authority [here](/entra/identity-platform/msal-client-application-configuration)
86+
87+
```csharp
88+
// Authenticate the certificate client with DefaultAzureCredential and get the certificate.
89+
CertificateClient certificateClient = new SecretClient(new Uri("https://myvault.vault.azure.net/"), new DefaultAzureCredential());
90+
X509Certificat2 cert = await certificateClient.DownloadCertificateAsync(certificateName);
91+
92+
// Get access token using certificate credentials
93+
string[] scopes = { "https://management.azure.com/.default" };
94+
string authority = "https://login.microsoftonline.com/<tenant>/";
95+
var application = ConfidentialClientApplicationBuilder
96+
.Create('<servicePrincipal-appId>')
97+
.WithAuthority(authorityUri: new Uri(authority), validateAuthority: true)
98+
.WithTenantId("<tenantId>")
99+
.WithCertificate(cert)
100+
.Build();
101+
102+
var token = await application
103+
.AcquireTokenForClient(scopes)
104+
.WithSendX5C(true)
105+
.ExecuteAsync();
106+
```
107+
108+
4. Authenticate EventGridManagementClient with access token using secret or certificate credentials
110109

111110

112111
```csharp
@@ -140,8 +139,8 @@ await eventGridClient.EventSubscriptions.CreateOrUpdateAsync(
140139
eventSubscriptionInfo: eventSubscription);
141140
```
142141

143-
## Update Event Subscription
144-
This code sample shows how to update the event subscription to add additional events you want to receive on the webhook subscriber endpoint.
142+
## Update event subscription
143+
This code sample shows how to update the event subscription to add more events, you want to receive on the webhook subscriber endpoint.
145144

146145
```csharp
147146
string webhookUri = $"<webhookUri>";
@@ -157,8 +156,8 @@ await eventGridClient.EventSubscriptions.UpdateAsync(
157156
filter: new EventSubscriptionFilter(includedEventTypes: additionalEventTypes)));
158157
```
159158

160-
## Delete Event Subscription
161-
This code sample shows how to delete the event susbcription for the webhook subscriber endpoint.
159+
## Delete event Subscription
160+
This code sample shows how to delete the event subscription for the webhook subscriber endpoint.
162161

163162
```csharp
164163
string webhookUri = $"<webhookUri>";

articles/communication-services/quickstarts/events/includes/create-eventsubscription-powershell.md renamed to articles/communication-services/quickstarts/events/includes/create-event-subscription-powershell.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: pgrandhi
1717

1818
[!INCLUDE [register-provider-powershell.md](register-provider-powershell.md)]
1919

20-
## Create Event Subscription
20+
## Create event subscription
2121

2222
First, make sure to install the Azure Communication Services module ```Az.EventGrid``` using the following command.
2323

@@ -51,7 +51,7 @@ New-AzEventGridSubscription
5151

5252
For a list of Communication Services events, see [Communication Services Events](../../../../../articles/event-grid/event-schema-communication-services.md).
5353

54-
## List Event Subscriptions
54+
## List event subscriptions
5555

5656
To list all the existing event subscriptions set up for an Azure Communication Services resource, by using the [Azure PowerShell](/powershell/azure/get-started-azureps), use the [`Get-AzEventGridSubscription`](/powershell/module/az.eventgrid/get-azeventgridsubscription) command.
5757

@@ -60,7 +60,7 @@ Get-AzEventGridSubscription
6060
-ResourceId "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Communication/CommunicationServices/<acsResourceName>"
6161
```
6262

63-
## Update Event Subscription
63+
## Update event subscription
6464

6565
To update an existing event subscription by using the [Azure PowerShell](/powershell/azure/get-started-azureps), use the [`Update-AzEventGridSubscription `](/powershell/module/az.eventgrid/update-azeventgridsubscription) command.
6666

@@ -75,7 +75,7 @@ Update-AzEventGridSubscription
7575
7676
```
7777

78-
## Delete Event Subscription
78+
## Delete event subscription
7979

8080
To delete an existing event subscription by using the [Azure PowerShell](/powershell/azure/get-started-azureps), use the [`Remove-AzEventGridSubscription`](/powershell/module/az.eventgrid/remove-azeventgridsubscription) command.
8181

@@ -86,4 +86,4 @@ Get-AzResource
8686

8787
## Next steps
8888

89-
* For information on other commands, see [Az.EventGrid Powershell Module](/powershell/module/az.eventgrid/new-azeventgridsubscription).
89+
* For information on other commands, see [Az.EventGrid PowerShell Module](/powershell/module/az.eventgrid/new-azeventgridsubscription).

articles/communication-services/quickstarts/events/includes/register-event-grid-resource-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.date: 01/26/2024
66
ms.author: pgrandhi
77
---
88

9-
## Register the Event Grid Resource Provider
9+
## Register the event grid resource provider
1010

1111
This article describes how to register Event Grid Resource Provider. If you have used Event Grid before in the same subscription, skip to the next section.
1212

articles/communication-services/quickstarts/events/includes/register-provider-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.date: 01/27/2024
77
ms.author: pgrandhi
88
---
99

10-
## Register Event Grid resource provider
10+
## Register the event grid resource provider
1111

1212
1. If you haven't previously used Event Grid in your Azure subscription, you might need to register the Event Grid resource provider. Run the following command to register the provider:
1313

articles/communication-services/quickstarts/events/includes/register-provider-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.date: 01/27/2024
77
ms.author: pgrandhi
88
---
99

10-
## Register Event Grid resource provider
10+
## Register the event grid resource provider
1111

12-
If you haven't previously used Event Grid in your Azure subscription, you may need to register the Event Grid resource provider. Run the following command:
12+
If you have not previously used Event Grid in your Azure subscription, you may need to register the Event Grid resource provider. Run the following command:
1313

1414
```PowerShell
1515
Register-AzResourceProvider -ProviderNamespace Microsoft.EventGrid

0 commit comments

Comments
 (0)