Skip to content

Commit 03a0303

Browse files
authored
Merge pull request #197883 from PatAltimore/patricka-dps
Add IoT Edge DPS reprovisioning detail
2 parents bb16c9c + 6e574c1 commit 03a0303

4 files changed

+67
-33
lines changed

articles/iot-edge/how-to-provision-devices-at-scale-linux-symmetric.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create and provision IoT Edge devices using symmetric keys on Linux - Azu
33
description: Use symmetric key attestation to test provisioning Linux devices at scale for Azure IoT Edge with device provisioning service
44
author: PatAltimore
55
ms.author: patricka
6-
ms.date: 10/29/2021
6+
ms.date: 05/12/2022
77
ms.topic: conceptual
88
ms.service: iot-edge
99
services: iot-edge
@@ -66,18 +66,19 @@ Have the following information ready:
6666

6767
The `provisioning:` line should have no preceding whitespace, and nested items should be indented by two spaces.
6868

69-
```yml
70-
# DPS TPM provisioning configuration
71-
provisioning:
72-
source: "dps"
73-
global_endpoint: "https://global.azure-devices-provisioning.net"
74-
scope_id: "PASTE_YOUR_SCOPE_ID_HERE"
75-
attestation:
76-
method: "symmetric_key"
77-
registration_id: "PASTE_YOUR_REGISTRATION_ID_HERE"
78-
symmetric_key: "PASTE_YOUR_PRIMARY_KEY_OR_DERIVED_KEY_HERE"
79-
# always_reprovision_on_startup: true
80-
# dynamic_reprovisioning: false
69+
```yml
70+
# DPS TPM provisioning configuration
71+
provisioning:
72+
source: "dps"
73+
global_endpoint: "https://global.azure-devices-provisioning.net"
74+
scope_id: "PASTE_YOUR_SCOPE_ID_HERE"
75+
attestation:
76+
method: "symmetric_key"
77+
registration_id: "PASTE_YOUR_REGISTRATION_ID_HERE"
78+
symmetric_key: "PASTE_YOUR_PRIMARY_KEY_OR_DERIVED_KEY_HERE"
79+
80+
# always_reprovision_on_startup: true
81+
# dynamic_reprovisioning: true
8182
```
8283

8384
1. Update the values of `scope_id`, `registration_id`, and `symmetric_key` with your DPS and device information.
@@ -110,26 +111,30 @@ Have the following information ready:
110111

111112
1. Find the **Provisioning** section of the file. Uncomment the lines for DPS provisioning with symmetric key, and make sure any other provisioning lines are commented out.
112113

113-
```toml
114-
# DPS provisioning with symmetric key
115-
[provisioning]
116-
source = "dps"
117-
global_endpoint = "https://global.azure-devices-provisioning.net"
118-
id_scope = "PASTE_YOUR_SCOPE_ID_HERE"
119-
120-
[provisioning.attestation]
121-
method = "symmetric_key"
122-
registration_id = "PASTE_YOUR_REGISTRATION_ID_HERE"
123-
124-
symmetric_key = { value = "PASTE_YOUR_PRIMARY_KEY_OR_DERIVED_KEY_HERE" }
125-
```
114+
```toml
115+
# DPS provisioning with symmetric key
116+
[provisioning]
117+
source = "dps"
118+
global_endpoint = "https://global.azure-devices-provisioning.net"
119+
id_scope = "PASTE_YOUR_SCOPE_ID_HERE"
120+
121+
[provisioning.attestation]
122+
method = "symmetric_key"
123+
registration_id = "PASTE_YOUR_REGISTRATION_ID_HERE"
124+
125+
symmetric_key = { value = "PASTE_YOUR_PRIMARY_KEY_OR_DERIVED_KEY_HERE" }
126+
127+
# auto_reprovisioning_mode = Dynamic
128+
```
126129

127130
1. Update the values of `id_scope`, `registration_id`, and `symmetric_key` with your DPS and device information.
128131

129132
The symmetric key parameter can accept a value of an inline key, a file URI, or a PKCS#11 URI. Uncomment just one symmetric key line, based on which format you're using.
130133

131134
If you use any PKCS#11 URIs, find the **PKCS#11** section in the config file and provide information about your PKCS#11 configuration.
132135

136+
1. Optionally, find the auto reprovisioning mode section of the file. Use the `auto_reprovisioning_mode` parameter to configure your device's reprovisioning behavior. **Dynamic** - Reprovision when the device detects that it may have been moved from one IoT Hub to another. This is the default. **AlwaysOnStartup** - Reprovision when the device is rebooted or a crash causes the daemon(s) to restart. **OnErrorOnly** - Never trigger device reprovisioning automatically. Each mode has an implicit device reprovisioning fallback if the device is unable to connect to IoT Hub during identity provisioning due to connectivity errors. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
137+
133138
1. Save and close the config.toml file.
134139

135140
1. Apply the configuration changes that you made to IoT Edge.

articles/iot-edge/how-to-provision-devices-at-scale-linux-tpm.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use a simulated TPM on a Linux device to test the Azure IoT Hub dev
44
author: PatAltimore
55
manager: lizross
66
ms.author: patricka
7-
ms.date: 10/28/2021
7+
ms.date: 05/13/2022
88
ms.topic: conceptual
99
ms.service: iot-edge
1010
services: iot-edge
@@ -196,6 +196,7 @@ After the runtime is installed on your device, configure the device with the inf
196196
attestation:
197197
method: "tpm"
198198
registration_id: "REGISTRATION_ID_HERE"
199+
199200
# always_reprovision_on_startup: true
200201
# dynamic_reprovisioning: false
201202
```
@@ -238,11 +239,13 @@ After the runtime is installed on your device, configure the device with the inf
238239
[provisioning.attestation]
239240
method = "tpm"
240241
registration_id = "REGISTRATION_ID_HERE"
242+
243+
# auto_reprovisioning_mode = Dynamic
241244
```
242245

243246
1. Update the values of `id_scope` and `registration_id` with your device provisioning service and device information. The `scope_id` value is the **ID Scope** from your device provisioning service instance's overview page.
244247

245-
1. Optionally, find the auto reprovisioning mode section of the file. Use the `auto_reprovisioning_mode` parameter to configure your device's reprovisioning behavior to either `Dynamic`, `AlwaysOnStartup`, or `OnErrorOnly`. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
248+
1. Optionally, find the auto reprovisioning mode section of the file. Use the `auto_reprovisioning_mode` parameter to configure your device's reprovisioning behavior. **Dynamic** - Reprovision when the device detects that it may have been moved from one IoT Hub to another. This is the default. **AlwaysOnStartup** - Reprovision when the device is rebooted or a crash causes the daemon(s) to restart. **OnErrorOnly** - Never trigger device reprovisioning automatically. Each mode has an implicit device reprovisioning fallback if the device is unable to connect to IoT Hub during identity provisioning due to connectivity errors. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
246249

247250
1. Save and close the file.
248251

articles/iot-edge/how-to-provision-devices-at-scale-linux-x509.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create and provision IoT Edge devices at scale using X.509 certificates o
33
description: Use X.509 certificates to test provisioning devices at scale for Azure IoT Edge with device provisioning service
44
author: PatAltimore
55
ms.author: patricka
6-
ms.date: 02/28/2022
6+
ms.date: 05/13/2022
77
ms.topic: conceptual
88
ms.service: iot-edge
99
services: iot-edge
@@ -107,8 +107,9 @@ Have the following information ready:
107107
# registration_id: "OPTIONAL_REGISTRATION_ID_LEAVE_COMMENTED_OUT_TO_REGISTER_WITH_CN_OF_IDENTITY_CERT"
108108
identity_cert: "REQUIRED_URI_TO_DEVICE_IDENTITY_CERTIFICATE_HERE"
109109
identity_pk: "REQUIRED_URI_TO_DEVICE_IDENTITY_PRIVATE_KEY_HERE"
110-
# always_reprovision_on_startup: true
111-
# dynamic_reprovisioning: false
110+
111+
# always_reprovision_on_startup: true
112+
# dynamic_reprovisioning: false
112113
```
113114

114115
1. Update the values of `scope_id`, `identity_cert`, and `identity_pk` with your DPS and device information.
@@ -164,6 +165,8 @@ Have the following information ready:
164165
identity_cert = "DEVICE_IDENTITY_CERTIFICATE_HERE"
165166

166167
identity_pk = "DEVICE_IDENTITY_PRIVATE_KEY_HERE"
168+
169+
# auto_reprovisioning_mode = Dynamic
167170
```
168171

169172
1. Update the value of `id_scope` with the scope ID you copied from your instance of DPS.
@@ -178,6 +181,8 @@ Have the following information ready:
178181

179182
If you use any PKCS#11 URIs, find the **PKCS#11** section in the config file and provide information about your PKCS#11 configuration.
180183

184+
1. Optionally, find the auto reprovisioning mode section of the file. Use the `auto_reprovisioning_mode` parameter to configure your device's reprovisioning behavior. **Dynamic** - Reprovision when the device detects that it may have been moved from one IoT Hub to another. This is the default. **AlwaysOnStartup** - Reprovision when the device is rebooted or a crash causes the daemon(s) to restart. **OnErrorOnly** - Never trigger device reprovisioning automatically. Each mode has an implicit device reprovisioning fallback if the device is unable to connect to IoT Hub during identity provisioning due to connectivity errors. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
185+
181186
1. Save and close the file.
182187

183188
1. Apply the configuration changes that you made to IoT Edge.

articles/iot-edge/troubleshoot-common-errors.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Or
153153
```output
154154
info: edgelet_docker::runtime -- Starting module edgeHub...
155155
warn: edgelet_utils::logging -- Could not start module edgeHub
156-
warn: edgelet_utils::logging -- caused by: failed to create endpoint edgeHub on network nat: hnsCall failed in Win32:
156+
warn: edgelet_utils::logging -- caused by: failed to create endpoint edgeHub on network nat: hnsCall failed in Win32:
157157
The process cannot access the file because it is being used by another process. (0x20)
158158
```
159159

@@ -317,6 +317,27 @@ Windows Registry Editor Version 5.00
317317
"TypesSupported"=dword:00000007
318318
```
319319

320+
## DPS client error
321+
322+
**Observed behavior:**
323+
324+
IoT Edge fails to start with error message `failed to provision with IoT Hub, and no valid device backup was found dps client error.`
325+
326+
**Root cause:**
327+
328+
A group enrollment is used to provision an IoT Edge device to an IoT Hub. The IoT Edge device is moved to a different hub. The registration is deleted in DPS. A new registration is created in DPS for the new hub. The device is not reprovisioned.
329+
330+
**Resolution:**
331+
332+
1. Verify your DPS credentials are correct.
333+
1. Apply your configuration using `sudo iotedge apply config`.
334+
1. If the device isn't reprovisioned, restart the device using `sudo iotedge system restart`.
335+
1. If the device isn't reprovisioned, force reprovisioning using `sudo iotedge system reprovision`.
336+
337+
To automatically reprovision, set `dynamic_reprovisioning: true` in the device configuration file. Setting this flag to true opts in to the dynamic re-provisioning feature. IoT Edge detects situations where the device appears to have been reprovisioned in the cloud by monitoring its own IoT Hub connection for certain errors. IoT Edge responds by shutting itself and all Edge modules down. The next time the daemon starts up, it will attempt to reprovision this device with Azure to receive the new IoT Hub provisioning information.
338+
339+
When using external provisioning, the daemon will also notify the external provisioning endpoint about the re-provisioning event before shutting down. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
340+
320341
:::moniker-end
321342
<!-- end 1.1 -->
322343

@@ -421,7 +442,7 @@ On Windows:
421442
422443
1. If the parameter exists, set the value of the parameter to **1**.
423444
424-
1. If the paramter doesn't exist, add it as a new parameter with the following settings:
445+
1. If the parameter doesn't exist, add it as a new parameter with the following settings:
425446
426447
| Setting | Value |
427448
| ------- | ----- |

0 commit comments

Comments
 (0)