Skip to content

Commit 6acde12

Browse files
committed
- content review
1 parent 40924ff commit 6acde12

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ This sample ASP.NET Core web application shows how to subscribe for change notif
3232

3333
This sample uses:
3434

35-
- [Microsoft Authentication Library for .NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) (MSAL.NET) to obtain an access token
35+
- [Microsoft Authentication Library for .NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) (MSAL.NET) to obtain an access token.
3636
- The [Microsoft Graph Client Library for .NET](https://github.com/microsoftgraph/msgraph-sdk-dotnet) (SDK) to call Microsoft Graph.
37-
- The [Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web) library to abstract some of the token acquisition complexities.
37+
- The [Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web) library to abstract token acquisition.
3838

3939
This sample supports user-delegated authentication and uses:
4040

41-
- OpenID Connect for sign in / sign out using the Microsoft identity platform for developers
42-
- The [auth code flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow)
41+
- OpenID Connect for sign in / sign out using the Microsoft identity platform for developers.
42+
- The [auth code flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
4343

4444
This sample supports app-only authentication and uses:
4545

@@ -53,7 +53,8 @@ The following are common tasks that an application performs with webhooks subscr
5353
- Use the access token to [create a subscription](https://docs.microsoft.com/graph/api/subscription-post-subscriptions) to a resource.
5454
- Send back a validation token to confirm the notification URL.
5555
- Listen for notifications from Microsoft Graph and respond with a 202 status code.
56-
- Request more information about changed resources using data in the notification or decrypts the resource data provided with the notification if any has been provided.
56+
- Request more information about changed resources using data in the notification if no data is provided with the notification.
57+
- Decrypts the resource data provided with the notification if any has been provided with the notification.
5758

5859
## Using the Microsoft Graph Webhooks Sample
5960

@@ -63,7 +64,7 @@ The screenshot below shows the app's start page.
6364

6465
After the app creates a subscription, Microsoft Graph sends a notification to the registered endpoint when events happen for the subscribed resource. The app then reacts to the event.
6566

66-
This sample app subscribes to any resource configured in `appsettings.json` in `SubscriptionSettings:Resource` (default is `me/messages`) for any change configured in `SubscriptionSettings:ChangeType` (default `created,updated`). When notified that of any notification, the app then updates a page with information about the resource.
67+
This sample app subscribes to any resource configured in `appsettings.json` in `SubscriptionSettings:Resource` (default is `me/messages`) for any change configured in `SubscriptionSettings:ChangeType` (default `created,updated`). When receiving any notification, the app then updates a page with information about the resource.
6768

6869
This project uses git submodules. After cloning the repository, make sure you execute the following commands:
6970

@@ -81,7 +82,7 @@ To use the Microsoft Graph Webhook Sample for ASP.NET Core, you need the followi
8182
- A [work, school or personal account](https://dev.office.com/devprogram). A tenant administrator account is required to grant application permissions.
8283
- The application ID and key from the application that you [register on the Azure Portal](#register-the-app).
8384
- A public HTTPS endpoint to receive and send HTTP requests. You can host this on Microsoft Azure or another service, or you can [use ngrok](#ngrok) or a similar tool while testing.
84-
- If you are also testing change notifications with resource data (preview), you also need a Microsoft Azure subscription to create an Azure KeyVault. If you do not have a Microsoft Azure subscription, you can [start a free trial](https://azure.microsoft.com/free/)
85+
- If you are also testing change notifications with resource data (preview), you also need a Microsoft Azure subscription to create an Azure KeyVault. If you do not have a Microsoft Azure subscription, you can [start a free trial](https://azure.microsoft.com/free/).
8586

8687
### Create your app
8788

@@ -99,14 +100,14 @@ To use the Microsoft Graph Webhook Sample for ASP.NET Core, you need the followi
99100

100101
![AadAppCreate3](docs/ad3.png)
101102
1. When the **Register an application page** appears, enter your app's registration information:
102-
1. In the **Name** section, enter a meaningful name that will be displayed to users of the app. For example: `MyWebApp`
103+
1. In the **Name** section, enter a meaningful name that will be displayed to users of the app. For example: `MyWebApp`.
103104
1. In the **Supported account types** section, select **Accounts in any organizational directory (Any Azure AD directory) and personal Microsoft accounts (e.g. Skype, Xbox)**.
104105
> You can leave the redirect URI empty, you'll add these from the **Authentication** tab later after the app has been successfully created.
105106
106107
![AadAppCreate4](docs/ad4.png)
107108
1. Select **Register** to create the app.
108109
1. On the app's **Overview** page, find the **Application (client) ID** value and record it for later. You'll need this value to configure the Visual Studio configuration file for this project.
109-
1. In the list of pages for the app, select **Authentication**. (this step is only required if you are using a user-delegated authentication context)
110+
1. In the list of pages for the app, select **Authentication**. (this step is only required if you are using a user-delegated authentication context):
110111
1. In the **Redirect URIs** section, select **Web** in the combo-box and enter the following redirect URIs:
111112
- `https://localhost:44334/signin-oidc`
112113
- `https://localhost:44334/Account/GrantPermissions`
@@ -134,7 +135,7 @@ To use the Microsoft Graph Webhook Sample for ASP.NET Core, you need the followi
134135

135136
### Setting up Azure Key Vault
136137

137-
*Note: you are only required to follow these steps if the resource you are subscribing to supports including resouces data in notifications and if you set `includeResourceData` to `true` in the configuration. In any other case, you can skip these steps. Refer to [the documentation](https://docs.microsoft.com/graph/api/resources/webhooks?view=graph-rest-beta) for a complete list of resources that support or not including resources data.*
138+
*Note: you are only required to follow these steps if the resource you are subscribing to supports including resources data in notifications and if you set `includeResourceData` to `true` in the configuration. In any other case, you can skip these steps. Refer to [the documentation](https://docs.microsoft.com/graph/api/resources/webhooks?view=graph-rest-beta) for a complete list of resources that support or not including resources data.*
138139

139140
Follow the [documented steps](./KEYVAULT.md) to configure your Azure KeyVault in order to add support for change notifications with resource data (preview).
140141

@@ -170,15 +171,17 @@ Keep the console open while testing. If you close it, the tunnel also closes and
170171
171172
## Configure and run the sample
172173

174+
> Note: To avoid errors while installing packages from dependencies, make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root drive resolves this issue.
175+
173176
1. Expose a public HTTPS notification endpoint. It can run on a service such as Microsoft Azure, or you can create a proxy web server by [using ngrok](#ngrok) or a similar tool.
174177

175178
1. Open the **GraphWebhooks-Core.sln** sample file in Visual Studio.
176179

177180
1. In Solution Explorer, open the **appsettings.json** file in the root directory of the project.
178181

179182
- Settings under **SubscriptionSettings**:
180-
- **ChangeType**: CSV; possible values created, updated, deleted
181-
- **Resource**: resource to create subscription for (e.g. teams/allMessages)
183+
- **ChangeType**: CSV; possible values created, updated, deleted.
184+
- **Resource**: resource to create subscription for (e.g. teams/allMessages).
182185
- **IncludeResourceData**: whether the notifications should include resource data. `true` or `false`
183186
- **NotificationUrl**: The HTTPS Notification URL that will receive subscription validation callbacks and notification events from Graph, replace *ENTER_YOUR_URL* with the HTTPS URL. Keep the */notification/listen* portion. If you're using ngrok, use the HTTPS URL that you copied eg `https://2885f9c5.ngrok.io/notification/listen`.
184187
- **Scope**: The permission to use to create the subscription, eg `Mail.Read` or `ChannelMessage.Read.All`.
@@ -216,8 +219,6 @@ Keep the console open while testing. If you close it, the tunnel also closes and
216219

217220
1. Make sure that the ngrok console is still running, then press F5 to build and run the solution in debug mode.
218221

219-
>If you get errors while installing packages, make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root drive resolves this issue.
220-
221222
### Use the app to create a subscription
222223

223224
#### Sign-in and grant permissions
@@ -303,7 +304,6 @@ You can suggest changes for Microsoft Graph on [UserVoice](https://microsoftgrap
303304

304305
## Additional resources
305306

306-
- [Microsoft Graph Webhooks sample for ASP.NET 4.6](https://github.com/microsoftgraph/aspnet-webhooks-rest-sample)
307307
- [Microsoft Graph Webhooks sample for Node.js](https://github.com/microsoftgraph/nodejs-webhooks-rest-sample) (Delegated permissions)
308308
- [Working with Webhooks in Microsoft Graph](https://docs.microsoft.com/graph/api/resources/webhooks)
309309
- [Subscription resource](https://docs.microsoft.com/graph/api/resources/subscription)

0 commit comments

Comments
 (0)