Skip to content

Commit 0fe820d

Browse files
authored
Merge pull request #44 from microsoftgraph/feature/troubleshooting-info
- fixes #35, adds troubleshooting information from the wiki
2 parents ba62c28 + 56531a2 commit 0fe820d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Troubleshooting
2+
3+
This document covers some of the common issues you may encounter when running this sample.
4+
5+
## You get a 403 Forbidden response when you attempt to create a subscription
6+
7+
Make sure that your app registration includes the required permission for Microsoft Graph (as described in the [Register the app](README.md#register-the-app) section). This permission must be set before you try to create a subscription. Otherwise you'll get an error. Then, make sure a tenant administrator has granted consent to the application.
8+
9+
## You do not receive notifications
10+
11+
If you're using ngrok, you can use the web interface [http://127.0.0.1:4040](http://127.0.0.1:4040) to see whether the notification is being received. If you're not using ngrok, monitor the network traffic using the tools your hosting service provides, or try using ngrok.
12+
13+
If Microsoft Graph is not sending notifications, please open a [Stack Overflow](https://stackoverflow.com/questions/tagged/MicrosoftGraph) issue tagged `MicrosoftGraph`. Include the subscription ID and the time it was created.
14+
15+
Known issue: Occasionally the notification is received, and the retrieved message is sent to NotificationService, but the SocketIo client in this sample does not update. When this happens, it's usually the first notification after the subscription is created.
16+
17+
## You get a "Subscription validation request timed out" response
18+
19+
This indicates that Microsoft Graph did not receive a validation response within the expected time frame (about 10 seconds).
20+
21+
- Make sure that you are not paused in the debugger when the validation request is received.
22+
- If you're using ngrok, make sure that you used your project's HTTP port for the tunnel (not HTTPS).
23+
24+
## You get errors while installing packages
25+
26+
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.
27+
28+
## Hosting the sample without a tunnel
29+
30+
Microsoft Graph (or any other webhook provider) needs a notification URL that it can reach to deliver notifications. The sample uses localhost as the development server.
31+
32+
Localhost just means this host. If any webhook provider would deliver a notification to localhost, it would be delivering it to itself. Not very useful.
33+
34+
Microsoft Graph can't deliver notifications to localhost. For this reason, we need a tunnel that can forward requests from a URL on the Internet to our localhost.
35+
36+
There are some alternatives that you can consider to try this sample without a tunnel.
37+
38+
### Host the sample on a cloud service
39+
40+
You can host the sample using a cloud service such as Microsoft Azure. Cloud services allow you to expose the notification URL to the Internet. Microsoft Graph can deliver notifications to the URL in the cloud.
41+
42+
Note that in some cases, you'll be able to deploy the sample to a website hosted in the cloud. In other cases, you'll need to set up a virtual machine and install a development environment with the prerequisites listed in the [ReadMe](../blob/master/README.md#prerequisites).
43+
44+
See your cloud provider's documentation for details about how to host a web application or virtual machine using the cloud service.
45+
46+
### Application registration on Azure Portal
47+
48+
The application in Azure must redirect your users to your application in the cloud. Use the following parameters to register your application with the [Office 365 app registration tool](http://dev.office.com/app-registration):
49+
50+
| Parameter | Value |
51+
|----------------:|:-----------------------------------|
52+
| App type | Web App |
53+
| Sign on URL | http://cloud_service_URL> |
54+
| Redirect URI | http://cloud_service_URL>/callback |
55+
| App permissions | Mail.Read |
56+
57+
Copy and store the **Client ID** and **Client Secret** values.
58+
59+
### Notification URL in file constants.js
60+
61+
Update the **notificationUrl** value in the file [`constants.js`](https://github.com/OfficeDev/Microsoft-Graph-Nodejs-Webhooks/blob/master/constants.js#L10) file to
62+
63+
```
64+
http://<cloud_service_URL>/listen
65+
```
66+
67+
From here, you can run `npm install && npm start` to install dependencies and start the application.

0 commit comments

Comments
 (0)