Skip to content

Commit 6a94e95

Browse files
authored
Merge pull request #46996 from wesmc7777/master
Usability Study updates for Set up cloud resources tutorial for DPS
2 parents 0d66b4e + bf03a5e commit 6a94e95

File tree

3 files changed

+61
-41
lines changed

3 files changed

+61
-41
lines changed
13.3 KB
Loading

articles/iot-dps/tutorial-set-up-cloud.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ This tutorial shows how to set up the cloud for automatic device provisioning us
2323
2424
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
2525

26-
## Log in to the Azure portal
26+
## Sign in to the Azure portal
2727

28-
Log in to the [Azure portal](https://portal.azure.com/).
28+
Sign in to the [Azure portal](https://portal.azure.com/).
2929

3030
## Create a Device Provisioning Service instance and get the ID scope
3131

@@ -45,9 +45,9 @@ Follow these steps to create a new Device Provisioning Service instance.
4545

4646
![Enter basic information about your DPS in the portal](./media/tutorial-set-up-cloud/create-iot-dps-portal.png)
4747

48-
5. Click **Create**.
49-
6. The *ID scope* is used to identify registration IDs, and provides a guarantee that the registration ID is unique. To obtain this value, click **Overview** to open the **Essentials** page for the Device Provisioning Service. Copy the **ID Scope** value to a temporary location for later use.
50-
7. Also make a note of the **Service endpoint** value, or copy it to a temporary location for later use.
48+
5. Click **Create**. After a few moments, the Device Provisioning Service instance is created and the **Overview** page is displayed.
49+
6. On the **Overview** page for the new service instance, copy the value for the **ID scope** for use later. That value is used to identify registration IDs, and provides a guarantee that the registration ID is unique.
50+
7. Also, copy the **Service endpoint** value for later use.
5151

5252
[!INCLUDE [iot-hub-get-started-create-hub](../../includes/iot-hub-get-started-create-hub.md)]
5353

@@ -60,8 +60,11 @@ The next step is to link the Device Provisioning Service and IoT hub so that the
6060
1. In the **All resources** page, click the Device Provisioning Service instance you created previously.
6161
2. In the Device Provisioning Service page, click **Linked IoT hubs**.
6262
3. Click **Add**.
63-
4. In the **Add link to IoT hub** page, use the radio buttons to specify whether the linked IoT hub is located in the current subscription, or in a different subscription. Then, choose the name of the IoT hub from the **IoT hub** box.
64-
5. Click **Save**.
63+
4. In the **Add link to IoT hub** page, provide the following information, and click **Save**:
64+
65+
* **Subscription:** Make sure the subscription that contains the IoT hub is selected. You can link to IoT hub that resides in a different subscription.
66+
* **IoT hub:** Choose the name of the IoT hub that you want to link with this Device Provisioning Service instance.
67+
* **Access Policy:** Select **iothubowner** as the credentials to use for establishing the link to the IoT hub.
6568

6669
![Link the hub name to link to the DPS in the portal](./media/tutorial-set-up-cloud/link-iot-hub-to-dps-portal.png)
6770

@@ -70,7 +73,7 @@ The next step is to link the Device Provisioning Service and IoT hub so that the
7073
The allocation policy is a IoT Hub Device Provisioning Service setting that determines how devices are assigned to an IoT hub. There are three supported allocation policies: 
7174

7275
1. **Lowest latency**: Devices are provisioned to an IoT hub based on the hub with the lowest latency to the device.
73-
2. **Evenly weighted distribution** (default): Linked IoT hubs are equally likely to have devices provisioned to them. This is the default setting. If you are provisioning devices to only one IoT hub, you can keep this setting. 
76+
2. **Evenly weighted distribution** (default): Linked IoT hubs are equally likely to have devices provisioned to them. This setting is the default. If you are provisioning devices to only one IoT hub, you can keep this setting. 
7477
3. **Static configuration via the enrollment list**: Specification of the desired IoT hub in the enrollment list takes priority over the Device Provisioning Service-level allocation policy.
7578

7679
To set the allocation policy, in the Device Provisioning Service page click **Manage allocation policy**. Make sure the allocation policy is set to **Evenly weighted distribution** (the default). If you make any changes, click **Save** when you are done.

articles/iot-dps/tutorial-set-up-device.md

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,74 @@ ms.custom: mvc
1313

1414
# Set up a device to provision using the Azure IoT Hub Device Provisioning Service
1515

16-
In the previous tutorial, you learned how to set up the Azure IoT Hub Device Provisioning Service to automatically provision your devices to your IoT hub. This tutorial shows you how to set up your device during the manufacturing process, enabling it to be auto-provisioned with IoT Hub. Your device is provisioned based on its [Attestation mechanism](concepts-device.md#attestation-mechanism), upon first boot and connection to the provisioning service. This tutorial discusses the processes to:
16+
In the previous tutorial, you learned how to set up the Azure IoT Hub Device Provisioning Service to automatically provision your devices to your IoT hub. This tutorial shows you how to set up your device during the manufacturing process, enabling it to be auto-provisioned with IoT Hub. Your device is provisioned based on its [Attestation mechanism](concepts-device.md#attestation-mechanism), upon first boot and connection to the provisioning service. This tutorial covers the following tasks:
1717

1818
> [!div class="checklist"]
1919
> * Build platform-specific Device Provisioning Services Client SDK
2020
> * Extract the security artifacts
2121
> * Create the device registration software
2222
23-
## Prerequisites
24-
25-
Before proceeding, create your Device Provisioning Service instance and an IoT hub, using the instructions in the previous [1 - Set up cloud resources](./tutorial-set-up-cloud.md) tutorial.
23+
This tutorial expects that you have already created your Device Provisioning Service instance and an IoT hub, using the instructions in the previous [Set up cloud resources](tutorial-set-up-cloud.md) tutorial.
2624

2725
This tutorial uses the [Azure IoT SDKs and libraries for C repository](https://github.com/Azure/azure-iot-sdk-c), which contains the Device Provisioning Service Client SDK for C. The SDK currently provides TPM and X.509 support for devices running on Windows or Ubuntu implementations. This tutorial is based on use of a Windows development client, which also assumes basic proficiency with Visual Studio 2017.
2826

2927
If you're unfamiliar with the process of auto-provisioning, be sure to review [Auto-provisioning concepts](concepts-auto-provisioning.md) before continuing.
3028

29+
30+
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
31+
32+
## Prerequisites
33+
34+
* Visual Studio 2015 or [Visual Studio 2017](https://www.visualstudio.com/vs/) with the ['Desktop development with C++'](https://www.visualstudio.com/vs/support/selecting-workloads-visual-studio-2017/) workload enabled.
35+
* Latest version of [Git](https://git-scm.com/download/) installed.
36+
37+
38+
3139
## Build a platform-specific version of the SDK
3240

3341
The Device Provisioning Service Client SDK helps you implement your device registration software. But before you can use it, you need to build a version of the SDK specific to your development client platform and attestation mechanism. In this tutorial, you build an SDK that uses Visual Studio 2017 on a Windows development platform, for a supported type of attestation:
3442

35-
1. Install the required tools and clone the GitHub repository that contains the provisioning service Client SDK for C:
36-
37-
a. Make sure you have either Visual Studio 2015 or [Visual Studio 2017](https://www.visualstudio.com/vs/) installed on your machine. You must have ['Desktop development with C++'](https://www.visualstudio.com/vs/support/selecting-workloads-visual-studio-2017/) workload enabled for your Visual Studio installation.
43+
1. Download the latest release version of the [CMake build system](https://cmake.org/download/). From that same site, look up the cryptographic hash for the version of the binary distribution you chose. Verify the downloaded binary using the corresponding cryptographic hash value. The following example used Windows PowerShell to verify the cryptographic hash for version 3.11.4 of the x64 MSI distribution:
3844

39-
b. Download and install the [CMake build system](https://cmake.org/download/). It is important that the Visual Studio with 'Desktop development with C++' workload is installed on your machine, **before** the CMake installation.
45+
```PowerShell
46+
PS C:\Users\wesmc\Downloads> $hash = get-filehash .\cmake-3.11.4-win64-x64.msi
47+
PS C:\Users\wesmc\Downloads> $hash.Hash -eq "56e3605b8e49cd446f3487da88fcc38cb9c3e9e99a20f5d4bd63e54b7a35f869"
48+
True
49+
```
4050
41-
c. Make sure `git` is installed on your machine and is added to the environment variables accessible to the command window. See [Software Freedom Conservancy's Git client tools](https://git-scm.com/download/) for the latest `git` tools, including **Git Bash**, a command-line Bash shell for interacting with your local Git repository.
51+
It is important that the Visual Studio prerequisites (Visual Studio and the 'Desktop development with C++' workload) are installed on your machine, **before** starting the `CMake` installation. Once the prerequisites are in place, and the download is verified, install the CMake build system.
4252
43-
d. Open Git Bash, and clone the "Azure IoT SDKs and libraries for C" repository. The clone command may take several minutes to complete, as it also downloads several dependant submodules:
53+
2. Open a command prompt or Git Bash shell. Execute the following command to clone the [Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c) GitHub repository:
4454
45-
```cmd/sh
46-
git clone https://github.com/Azure/azure-iot-sdk-c.git --recursive
47-
```
55+
```cmd/sh
56+
git clone https://github.com/Azure/azure-iot-sdk-c.git --recursive
57+
```
58+
The size of this repository is currently around 220 MB. You should expect this operation to take several minutes to complete.
4859
49-
e. Create a new `cmake` subdirectory inside of the newly created repository subdirectory:
5060
51-
```cmd/sh
52-
mkdir azure-iot-sdk-c/cmake
53-
```
61+
3. Create a `cmake` subdirectory in the root directory of the git repository, and navigate to that folder.
5462
55-
2. From the Git Bash command prompt, change into the azure-iot-sdk-c repository's `cmake` subdirectory:
63+
```cmd/sh
64+
cd azure-iot-sdk-c
65+
mkdir cmake
66+
cd cmake
67+
```
5668
57-
```cmd/sh
58-
cd azure-iot-sdk-c/cmake
59-
```
69+
4. Build the SDK for your development platform based on the attestation mechanisms you will be using. Use one of the following commands (also note the two trailing period characters for each command). Upon completion, CMake builds out the `/cmake` subdirectory with content specific to your device:
70+
71+
- For devices that use the TPM simulator for attestation:
6072
61-
3. Build the SDK for your development platform and one of the supported attestation mechanisms, using one of the following commands (also note the two trailing period characters). Upon completion, CMake builds out the `/cmake` subdirectory with content specific to your device:
62-
- For devices that use a physical TPM/HSM, or a simulated X.509 certificate for attestation:
6373
```cmd/sh
64-
cmake -Duse_prov_client:BOOL=ON ..
74+
cmake -Duse_prov_client:BOOL=ON -Duse_tpm_simulator:BOOL=ON ..
6575
```
6676
67-
- For devices that use the TPM simulator for attestation:
77+
- For any other device (physical TPM/HSM/X.509, or a simulated X.509 certificate):
78+
6879
```cmd/sh
69-
cmake -Duse_prov_client:BOOL=ON -Duse_tpm_simulator:BOOL=ON ..
80+
cmake -Duse_prov_client:BOOL=ON ..
7081
```
7182
83+
7284
Now you're ready to use the SDK to build your device registration code.
7385
7486
<a id="extractsecurity"></a>
@@ -77,19 +89,23 @@ Now you're ready to use the SDK to build your device registration code.
7789
7890
The next step is to extract the security artifacts for the attestation mechanism used by your device.
7991
80-
### Physical device
92+
### Physical devices
8193
82-
If you built the SDK to use attestation from a physical TPM/HSM:
94+
Depending on whether you built the SDK to use attestation for a physical TPM/HSM or using X.509 certificates, gathering the security artifacts is as follows:
8395
8496
- For a TPM device, you need to determine the **Endorsement Key** associated with it from the TPM chip manufacturer. You can derive a unique **Registration ID** for your TPM device by hashing the endorsement key.
8597
86-
- For an X.509 device, you need to obtain the certificates issued to your device(s) - end-entity certificates for individual device enrollments, while root certificates for group enrollments of devices.
98+
- For an X.509 device, you need to obtain the certificates issued to your device(s). The provisioning service exposes two types of enrollment entries that control access for devices using the X.509 attestation mechanism. The certificates needed depend on the enrollment types you will be using.
8799
88-
### Simulated device
100+
1. Individual enrollments: Enrollment for a specific single device. This type of enrollment entry requires [end-entity, "leaf", certificates](concepts-security.md#end-entity-leaf-certificate).
101+
2. Enrollment groups: This type of enrollment entry requires intermediate or root certificates. For more information, see [Controlling device access to the provisioning service with X.509 certificates](concepts-security.md#controlling-device-access-to-the-provisioning-service-with-x509-certificates).
89102
90-
If you built the SDK to use attestation from a simulated TPM or X.509 certificate:
103+
### Simulated devices
104+
105+
Depending on whether you built the SDK to use attestation for a simulated device using TPM or X.509 certificates, gathering the security artifacts is as follows:
91106
92107
- For a simulated TPM device:
108+
93109
1. Open a Windows Command Prompt, navigate to the `azure-iot-sdk-c` subdirectory, and run the TPM simulator. It listens over a socket on ports 2321 and 2322. Do not close this command window; you will need to keep this simulator running until the end of the following Quickstart.
94110
95111
From the `azure-iot-sdk-c` subdirectory, run the following command to start the simulator:
@@ -105,14 +121,15 @@ If you built the SDK to use attestation from a simulated TPM or X.509 certificat
105121
106122
3. In the *Solution Explorer* pane in Visual Studio, navigate to the folder **Provision\_Tools**. Right-click the **tpm_device_provision** project and select **Set as Startup Project**.
107123
108-
4. Run the solution using either of the "Start" commands on the "Debug" menu. The output window displays the TPM simulator's **_Registration ID_** and the **_Endorsement Key_**, needed for device enrollment and registration. Copy these values for use later. You can close this window (with Registration Id and Endorsement Key), but leave the TPM simulator window running that you started in step #1.
124+
4. Run the solution using either of the "Start" commands on the "Debug" menu. The output window displays the TPM simulator's **_Registration ID_** and the **_Endorsement Key_**, needed for device enrollment and registration. Copy these values for use later. You can close this window (with Registration ID and Endorsement Key), but leave the TPM simulator window running that you started in step #1.
109125
110126
- For a simulated X.509 device:
127+
111128
1. Using Visual Studio, open the solution generated in the *cmake* folder named `azure_iot_sdks.sln`, and build it using the "Build solution" command on the "Build" menu.
112129
113130
2. In the *Solution Explorer* pane in Visual Studio, navigate to the folder **Provision\_Tools**. Right-click the **dice\_device\_enrollment** project and select **Set as Startup Project**.
114131
115-
3. Run the solution using either of the "Start" commands on the "Debug" menu. In the output window, enter **i** for individual enrollment when prompted. The output window displays a locally generated X.509 certificate for your simulated device. Copy to clipboard the output starting from *-----BEGIN CERTIFICATE-----* and ending at the first *-----END CERTIFICATE-----*, making sure to include both of these lines as well. Note that you need only the first certificate from the output window.
132+
3. Run the solution using either of the "Start" commands on the "Debug" menu. In the output window, enter **i** for individual enrollment when prompted. The output window displays a locally generated X.509 certificate for your simulated device. Copy to clipboard the output starting from *-----BEGIN CERTIFICATE-----* and ending at the first *-----END CERTIFICATE-----*, making sure to include both of these lines as well. You only need the first certificate from the output window.
116133
117134
4. Create a file named **_X509testcert.pem_**, open it in a text editor of your choice, and copy the clipboard contents to this file. Save the file as you will use it later for device enrollment. When your registration software runs, it uses the same certificate during auto-provisioning.
118135

0 commit comments

Comments
 (0)