Skip to content

Commit c069897

Browse files
authored
Merge pull request #87907 from xujing-ms/master
adding troubleshooting document for DPS
2 parents c648fec + 92dc2d2 commit c069897

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Diagnose and troubleshoot disconnects with Azure IoT Hub DPS
3+
description: Learn to diagnose and troubleshoot common errors with device connectivity for Azure IoT Hub DPS
4+
author: xujing-ms
5+
manager: nberdy
6+
ms.service: iot-dps
7+
services: iot-dps
8+
ms.topic: conceptual
9+
ms.date: 09/09/2019
10+
ms.author: xujing
11+
# As an operator for Azure IoT Hub DPS, I need to know how to find out when devices are disconnecting unexpectedly and troubleshoot resolve those issues right away
12+
---
13+
# Troubleshooting with Azure IoT Hub Device Provisioning Service
14+
15+
Connectivity issues for IoT devices can be difficult to troubleshoot because there are many possible points of failures such as attestation failures, registration failures etc. This article provides guidance on how to detect and troubleshoot device connectivity issues via [Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/overview).
16+
17+
## Using Azure Monitor to view metrics and set up alerts
18+
19+
The following procedure describes how to view and set up alert on IoT Hub Device Provisioning Service metric.
20+
21+
1. Sign in to the [Azure portal](https://portal.azure.com).
22+
23+
2. Browse to your IoT Hub Device Provisioning Service.
24+
25+
3. Select **Metrics**.
26+
27+
4. Select the desired metric.
28+
<br />Currently there are three metrics for DPS:
29+
30+
| Metric Name | Description |
31+
|-------|------------|
32+
| Attestation attempts | Number of devices that attempted to authenticate with Device Provisioning Service|
33+
| Registration attempts | Number of devices that attempted to register to IoT Hub after successful authentication|
34+
| Device assigned | Number of devices that successfully assigned to IoT Hub|
35+
36+
5. Select desired aggregation method to create a visual view of the metric.
37+
38+
6. To set up an alert of a metric, select **New alert rules** from the top right of the metric blade, similarly you can go to **Alert** blade and select **New alert rules**.
39+
40+
7. Select **Add condition**, then select the desired metric and threshold by following prompts.
41+
42+
To learn more, see [What are classic alerts in Microsoft Azure?](../azure-monitor/platform/alerts-overview.md)
43+
44+
## Using Log Analytic to view and resolve errors
45+
46+
1. Sign in to the [Azure portal](https://portal.azure.com).
47+
48+
2. Browse to your IoT hub.
49+
50+
3. Select **Diagnostics settings**.
51+
52+
4. Select **Turn on diagnostics**.
53+
54+
5. Enable the desired logs to be collected.
55+
56+
| Log Name | Description |
57+
|-------|------------|
58+
| DeviceOperations | Logs related to device connection events |
59+
| ServiceOperations | Event logs related to using service SDK (e.g. Creating or updating enrollment groups)|
60+
61+
6. Turn on **Send to Log Analytics** ([see pricing](https://azure.microsoft.com/pricing/details/log-analytics/)).
62+
63+
7. Go to **Logs** tab in the Azure portal under Device Provisioning Service resource.
64+
65+
8. Click **Run** to view recent events.
66+
67+
9. If there are results, look for `OperationName`, `ResultType`, `ResultSignature`, and `ResultDescription` (error message) to get more detail on the error.
68+
69+
70+
## Common error codes
71+
Use this table to understand and resolve common errors.
72+
73+
| Error Code| Description | HTTP Status Code |
74+
|-------|------------|------------|
75+
| 400 | The body of the request is not valid; for example, it cannot be parsed, or the object cannot be validated.| 400 Bad format |
76+
| 401 | The authorization token cannot be validated; for example, it is expired or does not apply to the request’s URI. This error code is also returned to devices as part of the TPM attestation flow. | 401 Unauthorized|
77+
| 404 | The Device Provisioning Service instance, or a resource (e.g. an enrollment) does not exist. |404 Not Found |
78+
| 412 | The ETag in the request does not match the ETag of the existing resource, as per RFC7232. | 412 Precondition failed |
79+
| 429 | Operations are being throttled by the service. For specific service limits, see [IoT Hub Device Provisioning Service limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-device-provisioning-service-limits). | 429 Too many requests |
80+
| 500 | An internal error occurred. | 500 Internal Server Error|

articles/iot-dps/toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
- name: Manage disenrollment
118118
href: how-to-revoke-device-access-portal.md
119119
- name: Manage deprovisioning
120-
href: how-to-unprovision-devices.md
120+
href: how-to-unprovision-devices.md
121121
- name: Manage Device Provisioning Service
122122
items:
123123
- name: Configure Device Provisioning Service using Azure CLI
@@ -142,6 +142,8 @@
142142
href: how-to-legacy-device-symm-key.md
143143
- name: Use SDK tools for development
144144
href: how-to-use-sdk-tools.md
145+
- name: Troubleshooting
146+
href: how-to-troubleshoot-dps.md
145147
- name: Reference
146148
items:
147149
- name: REST API

0 commit comments

Comments
 (0)