Skip to content

Commit f796490

Browse files
Merge pull request #301092 from PatAltimore/patricka-freshness2
Freshness review
2 parents 2de3a20 + 3904730 commit f796490

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

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

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure IoT Edge
44
description: Use X.509 certificates to test provisioning devices at scale for Azure IoT Edge with device provisioning service
55
author: PatAltimore
66
ms.author: patricka
7-
ms.date: 06/13/2024
7+
ms.date: 06/09/2025
88
ms.topic: how-to
99
ms.service: azure-iot-edge
1010
ms.custom: linux-related-content
@@ -15,18 +15,18 @@ services: iot-edge
1515

1616
[!INCLUDE [iot-edge-version-all-supported](includes/iot-edge-version-all-supported.md)]
1717

18-
This article provides end-to-end instructions for autoprovisioning one or more Linux IoT Edge devices using X.509 certificates. You can automatically provision Azure IoT Edge devices with the [Azure IoT Hub device provisioning service](../iot-dps/index.yml) (DPS). If you're unfamiliar with the process of autoprovisioning, review the [provisioning overview](../iot-dps/about-iot-dps.md#provisioning-process) before continuing.
18+
This article gives step-by-step instructions for autoprovisioning one or more Linux IoT Edge devices using X.509 certificates. Automatically provision Azure IoT Edge devices with the [Azure IoT Hub device provisioning service](../iot-dps/index.yml) (DPS). If you aren't familiar with autoprovisioning, review the [provisioning overview](../iot-dps/about-iot-dps.md#provisioning-process) before you continue.
1919

20-
The tasks are as follows:
20+
Here are the steps to provision IoT Edge devices using X.509 certificates:
2121

2222
1. Generate certificates and keys.
23-
1. Create either an **individual enrollment** for a single device or a **group enrollment** for a set of devices.
23+
1. Create an **individual enrollment** for a single device or a **group enrollment** for a set of devices.
2424
1. Install the IoT Edge runtime and register the device with IoT Hub.
2525

26-
Using X.509 certificates as an attestation mechanism is an excellent way to scale production and simplify device provisioning. Typically, X.509 certificates are arranged in a certificate chain of trust. Starting with a self-signed or trusted root certificate, each certificate in the chain signs the next lower certificate. This pattern creates a delegated chain of trust from the root certificate down through each intermediate certificate to the final downstream device certificate installed on a device.
26+
X.509 certificates let you scale production and simplify device provisioning. Typically, X.509 certificates are arranged in a certificate chain of trust. The chain starts with a self-signed or trusted root certificate, and each certificate in the chain signs the next lower certificate. This pattern creates a delegated chain of trust from the root certificate through each intermediate certificate to the final downstream device certificate installed on a device.
2727

2828
> [!TIP]
29-
> If your device has a Hardware Security Module (HSM) such as a TPM 2.0, then we recommend storing the X.509 keys securely in the HSM. Learn more about how to implement the zero-touch provisioning at scale described in [this blueprint](https://azure.microsoft.com/blog/the-blueprint-to-securely-solve-the-elusive-zerotouch-provisioning-of-iot-devices-at-scale) with the [iotedge-tpm2cloud](https://aka.ms/iotedge-tpm2cloud) sample.
29+
> If your device has a Hardware Security Module (HSM) like a TPM 2.0, store the X.509 keys securely in the HSM. Learn how to implement zero-touch provisioning at scale in [this blueprint](https://azure.microsoft.com/blog/the-blueprint-to-securely-solve-the-elusive-zerotouch-provisioning-of-iot-devices-at-scale) with the [iotedge-tpm2cloud](https://aka.ms/iotedge-tpm2cloud) sample.
3030
3131
## Prerequisites
3232

@@ -35,32 +35,32 @@ Using X.509 certificates as an attestation mechanism is an excellent way to scal
3535

3636
### Device requirements
3737

38-
A physical or virtual Linux device to be the IoT Edge device.
38+
Use a physical or virtual Linux device as the IoT Edge device.
3939

4040
## Generate device identity certificates
4141

4242
The device identity certificate is a downstream device certificate that connects through a certificate chain of trust to the top X.509 certificate authority (CA) certificate. The device identity certificate must have its common name (CN) set to the device ID that you want the device to have in your IoT hub.
4343

44-
Device identity certificates are only used for provisioning the IoT Edge device and authenticating the device with Azure IoT Hub. They aren't signing certificates, unlike the CA certificates that the IoT Edge device presents to modules or downstream devices for verification. For more information, see [Azure IoT Edge certificate usage detail](iot-edge-certs.md).
44+
Device identity certificates are only used for provisioning the IoT Edge device and authenticating the device with Azure IoT Hub. These certificates aren't signing certificates. CA certificates that the IoT Edge device presents to modules or downstream devices are used for verification. For more information, see [Azure IoT Edge certificate usage detail](iot-edge-certs.md).
4545

46-
After you create the device identity certificate, you should have two files: a .cer or .pem file that contains the public portion of the certificate, and a .cer or .pem file with the private key of the certificate. If you plan to use group enrollment in DPS, you also need the public portion of an intermediate or root CA certificate in the same certificate chain of trust.
46+
After you create the device identity certificate, you have two files: a `.cer` or `.pem` file with the public portion of the certificate, and a `.cer` or `.pem` file with the private key. If you use group enrollment in DPS, you also need the public portion of an intermediate or root CA certificate in the same certificate chain of trust.
4747

48-
You need the following files to set up automatic provisioning with X.509:
48+
You need these files to set up automatic provisioning with X.509:
4949

5050
* The device identity certificate and its private key certificate. The device identity certificate is uploaded to DPS if you create an individual enrollment. The private key is passed to the IoT Edge runtime.
51-
* A full chain certificate, which should have at least the device identity and the intermediate certificates in it. The full chain certificate is passed to the IoT Edge runtime.
51+
* A full chain certificate with at least the device identity and the intermediate certificates. The full chain certificate is passed to the IoT Edge runtime.
5252
* An intermediate or root CA certificate from the certificate chain of trust. This certificate is uploaded to DPS if you create a group enrollment.
5353

5454
### Use test certificates (optional)
5555

56-
If you don't have a certificate authority available to create new identity certs and want to try out this scenario, the Azure IoT Edge git repository contains scripts that you can use to generate test certificates. These certificates are designed for development testing only, and must not be used in production.
56+
If you don't have a certificate authority to create new identity certificates and want to try this scenario, use the scripts in the Azure IoT Edge git repository to generate test certificates. Use these certificates for development testing only. Don't use them in production.
5757

58-
To create test certificates, follow the steps in [Create demo certificates to test IoT Edge device features](how-to-create-test-certificates.md). Complete the two required sections to set up the certificate generation scripts and to create a root CA certificate. Then, follow the steps to create a device identity certificate. When you're finished, you should have the following certificate chain and key pair:
58+
To create test certificates, follow the steps in [Create demo certificates to test IoT Edge device features](how-to-create-test-certificates.md). Complete the two required sections to set up the certificate generation scripts and create a root CA certificate. Then, follow the steps to create a device identity certificate. When you finish, you have the following certificate chain and key pair:
5959

6060
* `<WRKDIR>/certs/iot-edge-device-identity-<name>-full-chain.cert.pem`
6161
* `<WRKDIR>/private/iot-edge-device-identity-<name>.key.pem`
6262

63-
You need both these certificates on the IoT Edge device. If you're going to use individual enrollment in DPS, then you upload the .cert.pem file. If you're going to use group enrollment in DPS, then you also need an intermediate or root CA certificate in the same certificate chain of trust to upload. If you're using demo certs, use the `<WRKDIR>/certs/azure-iot-test-only.root.ca.cert.pem` certificate for group enrollment.
63+
You need both certificates on the IoT Edge device. If you use individual enrollment in DPS, upload the `.cert.pem` file. If you use group enrollment in DPS, also upload an intermediate or root CA certificate in the same certificate chain of trust. If you use demo certificates, use the `<WRKDIR>/certs/azure-iot-test-only.root.ca.cert.pem` certificate for group enrollment.
6464

6565
<!-- Create a DPS enrollment using X.509 certificates H2 and content -->
6666
[!INCLUDE [iot-edge-create-dps-enrollment-x509.md](includes/iot-edge-create-dps-enrollment-x509.md)]
@@ -70,29 +70,29 @@ You need both these certificates on the IoT Edge device. If you're going to use
7070

7171
## Provision the device with its cloud identity
7272

73-
Once the runtime is installed on your device, configure the device with the information it uses to connect to the device provisioning service and IoT Hub.
73+
After you install the runtime on your device, set up the device with the information it uses to connect to the device provisioning service and IoT Hub.
7474

75-
Have the following information ready:
75+
Make sure you have the following information:
7676

77-
* The DPS **ID Scope** value. You can retrieve this value from the overview page of your DPS instance in the Azure portal.
77+
* The DPS **ID Scope** value. Get this value from the overview page of your DPS instance in the Azure portal.
7878
* The device identity certificate chain file on the device.
7979
* The device identity key file on the device.
8080

81-
Create a configuration file for your device based on a template file that is provided as part of the IoT Edge installation.
81+
Create a configuration file for your device based on the template file that's included with the IoT Edge installation.
8282

8383
# [Ubuntu / Debian / RHEL](#tab/ubuntu+debian+rhel)
8484

8585
```bash
8686
sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml
8787
```
8888

89-
Open the configuration file on the IoT Edge device.
89+
Open the configuration file on your IoT Edge device.
9090

9191
```bash
9292
sudo nano /etc/aziot/config.toml
9393
```
9494

95-
Find the **Provisioning** section of the file. Uncomment the lines for DPS provisioning with X.509 certificate, and make sure any other provisioning lines are commented out.
95+
Find the **Provisioning** section of the file. Uncomment the lines for DPS provisioning with X.509 certificate, and make sure all other provisioning lines are commented out.
9696

9797
```toml
9898
# DPS provisioning with X.509 certificate
@@ -116,19 +116,19 @@ identity_pk = "DEVICE_IDENTITY_PRIVATE_KEY_HERE" # For example, "file:///var/a
116116

117117
# [Ubuntu Core snaps](#tab/snaps)
118118

119-
If using a snap installation of IoT Edge, the template file is located at `/snap/azure-iot-edge/current/etc/aziot/config.toml.edge.template`. Create a copy of the template file in your home directory and name it config.toml. For example:
119+
If you use a snap installation of IoT Edge, the template file is at `/snap/azure-iot-edge/current/etc/aziot/config.toml.edge.template`. Copy the template file to your home directory and name it `config.toml`. For example:
120120

121121
```bash
122122
cp /snap/azure-iot-edge/current/etc/aziot/config.toml.edge.template ~/config.toml
123123
```
124124

125-
Open the configuration file in your home directory on the IoT Edge device.
125+
Open the configuration file in your home directory on your IoT Edge device.
126126

127127
```bash
128128
nano ~/config.toml
129129
```
130130

131-
Find the **Provisioning** section of the file. Uncomment the lines for DPS provisioning with X.509 certificate, and make sure any other provisioning lines are commented out. The path used for the certificate files should be the path to the shared directory accessible to both *azure-iot-edge* and *azure-iot-identity* snaps. For example, `/var/snap/azure-iot-identity/current/shared/`.
131+
Find the **Provisioning** section of the file. Uncomment the lines for DPS provisioning with X.509 certificate, and make sure any other provisioning lines are commented out. Use the path to the shared directory that's accessible to both *azure-iot-edge* and *azure-iot-identity* snaps for the certificate files. For example, `/var/snap/azure-iot-identity/current/shared/`.
132132

133133
```toml
134134
# DPS provisioning with X.509 certificate
@@ -153,29 +153,29 @@ identity_pk = "DEVICE_IDENTITY_PRIVATE_KEY_HERE" # For example, "file:///var/s
153153

154154
---
155155

156-
1. Update the value of `id_scope` with the scope ID you copied from your instance of DPS.
156+
1. Update the value of `id_scope` with the scope ID you copied from your DPS instance.
157157

158-
1. Provide a `registration_id` for the device, which is the ID that the device has in IoT Hub. The registration ID must match the common name (CN) of the identity certificate.
158+
1. Enter a `registration_id` for the device, which is the ID the device has in IoT Hub. The registration ID must match the common name (CN) of the identity certificate.
159159

160160
1. Update the values of `identity_cert` and `identity_pk` with your certificate and key information.
161161

162-
The identity certificate value can be provided as a file URI, or can be dynamically issued using EST or a local certificate authority. Uncomment only one line, based on the format you choose to use.
162+
You can provide the identity certificate value as a file URI, or it can be dynamically issued using EST or a local certificate authority. Uncomment only one line, based on the format you use.
163163

164-
The identity private key value can be provided as a file URI or a PKCS#11 URI. Uncomment only one line, based on the format you choose to use.
164+
You can provide the identity private key value as a file URI or a PKCS#11 URI. Uncomment only one line, based on the format you use.
165165

166-
If you use any PKCS#11 URIs, find the **PKCS#11** section in the config file and provide information about your PKCS#11 configuration.
166+
If you use any PKCS#11 URIs, find the **PKCS#11** section in the config file and enter your PKCS#11 configuration information.
167167

168168
For more information about certificates, see [Manage IoT Edge certificates](how-to-manage-device-certificates.md).
169169

170170
For more information about provisioning configuration settings, see [Configure IoT Edge device settings](configure-device.md#provisioning).
171171

172-
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 daemons 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).
172+
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 can 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 daemons to restart. **OnErrorOnly** - Never trigger device reprovisioning automatically. Each mode has an implicit device reprovisioning fallback if the device can't connect to IoT Hub during identity provisioning because of connectivity errors. For more information, see [IoT Hub device reprovisioning concepts](../iot-dps/concepts-device-reprovision.md).
173173

174-
1. Optionally, uncomment the `payload` parameter to specify the path to a local JSON file. The contents of the file is [sent to DPS as additional data](../iot-dps/how-to-send-additional-data.md#iot-edge-support) when the device registers. This is useful for [custom allocation](../iot-dps/how-to-use-custom-allocation-policies.md). For example, if you want to allocate your devices based on an IoT Plug and Play model ID without human intervention.
174+
1. Optionally, uncomment the `payload` parameter to specify the path to a local JSON file. The contents of the file are [sent to DPS as additional data](../iot-dps/how-to-send-additional-data.md#iot-edge-support) when the device registers. This is useful for [custom allocation](../iot-dps/how-to-use-custom-allocation-policies.md). For example, if you want to allocate your devices based on an IoT Plug and Play model ID without human intervention.
175175

176176
1. Save and close the file.
177177

178-
Apply the configuration changes that you made to IoT Edge.
178+
Apply the configuration changes you made to IoT Edge.
179179

180180
# [Ubuntu / Debian / RHEL](#tab/ubuntu+debian+rhel)
181181
```bash
@@ -192,27 +192,27 @@ sudo snap set azure-iot-edge raw-config="$(cat ~/config.toml)"
192192

193193
## Verify successful installation
194194

195-
If the runtime started successfully, you can go into your IoT Hub and start deploying IoT Edge modules to your device.
195+
If the runtime starts successfully, go to your IoT Hub and start deploying IoT Edge modules to your device.
196196

197197
# [Individual enrollment](#tab/individual-enrollment)
198198

199-
You can verify that the individual enrollment that you created in device provisioning service was used. Navigate to your device provisioning service instance in the Azure portal. Open the enrollment details for the individual enrollment that you created. Notice that the status of the enrollment is **assigned** and the device ID is listed.
199+
Check that the individual enrollment you created in device provisioning service is used. Go to your device provisioning service instance in the Azure portal. Open the enrollment details for the individual enrollment you created. The status of the enrollment is **assigned**, and the device ID is listed.
200200

201201
# [Group enrollment](#tab/group-enrollment)
202202

203-
You can verify that the group enrollment that you created in device provisioning service was used. Navigate to your device provisioning service instance in the Azure portal. Open the enrollment details for the group enrollment that you created. Go to the **Registration Records** tab to view all devices registered in that group.
203+
Check that the group enrollment you created in device provisioning service is used. Go to your device provisioning service instance in the Azure portal. Open the enrollment details for the group enrollment you created. Go to the **Registration Records** tab to view all devices registered in that group.
204204

205205
---
206206

207-
Use the following commands on your device to verify that the IoT Edge installed and started successfully.
207+
Run these commands on your device to check that IoT Edge is installed and running.
208208

209209
Check the status of the IoT Edge service.
210210

211211
```cmd/sh
212212
sudo iotedge system status
213213
```
214214

215-
Examine service logs.
215+
View service logs.
216216

217217
```cmd/sh
218218
sudo iotedge system logs
@@ -226,4 +226,4 @@ sudo iotedge list
226226

227227
## Next steps
228228

229-
The device provisioning service enrollment process lets you set the device ID and device twin tags at the same time as you provision the new device. You can use those values to target individual devices or groups of devices using automatic device management. Learn how to [Deploy and monitor IoT Edge modules at scale using the Azure portal](how-to-deploy-at-scale.md) or [using Azure CLI](how-to-deploy-cli-at-scale.md).
229+
The device provisioning service enrollment process lets you set the device ID and device twin tags when you provision a new device. Use these values to target individual devices or groups of devices with automatic device management. Learn how to [deploy and monitor IoT Edge modules at scale using the Azure portal](how-to-deploy-at-scale.md) or [using Azure CLI](how-to-deploy-cli-at-scale.md).

0 commit comments

Comments
 (0)