You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-dps/quick-create-simulated-device-symm-key.md
+28-33Lines changed: 28 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,23 @@ title: Quickstart - Provision a simulated symmetric key device to Microsoft Azur
3
3
description: Learn how to provision a device that authenticates with a symmetric key in the Azure IoT Hub Device Provisioning Service (DPS)
4
4
author: kgremban
5
5
ms.author: kgremban
6
-
ms.date: 09/29/2021
6
+
ms.date: 04/06/2023
7
7
ms.topic: quickstart
8
8
ms.service: iot-dps
9
9
services: iot-dps
10
10
manager: lizross
11
11
ms.custom: mvc, mode-other
12
12
zone_pivot_groups: iot-dps-set1
13
-
#Customer intent: As a new IoT developer, I want to connect a device to an IoT Hub using the SDK, to learn how secure provisioning works with symmetric keys.
13
+
#Customer intent: As a new IoT developer, I want to connect a device to an IoT hub using the SDK, to learn how secure provisioning works with symmetric keys.
14
14
---
15
15
16
16
# Quickstart: Provision a simulated symmetric key device
17
17
18
-
In this quickstart, you'll create a simulated device on your Windows machine. The simulated device will be configured to use the [symmetric key attestation](concepts-symmetric-key-attestation.md) mechanism for authentication. After you've configured your device, you'll then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
18
+
In this quickstart, you create a simulated device on your Windows machine. The simulated device is configured to use the [symmetric key attestation](concepts-symmetric-key-attestation.md) mechanism for authentication. After you've configured your device, you then provision it to your IoT hub using the Azure IoT Hub Device Provisioning Service.
19
19
20
20
If you're unfamiliar with the process of provisioning, review the [provisioning](about-iot-dps.md#provisioning-process) overview.
21
21
22
-
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: provision for geolatency](how-to-provision-multitenant.md).
22
+
This quickstart demonstrates a solution for a Windows-based workstation. However, you can also perform the procedures on Linux. For a Linux example, see [Tutorial: provision for geo latency](how-to-provision-multitenant.md).
23
23
24
24
## Prerequisites
25
25
@@ -206,7 +206,7 @@ Once you create the individual enrollment, a **primary key** and **secondary key
206
206
207
207
1. Copy the value of the generated **Primary key**.
208
208
209
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-device-enrollment-primary-key.png" alt-text="Copy the primary key of the device enrollment":::
209
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-device-enrollment-primary-key.png" alt-text="Screenshot showing the enrollment details, highlighting the Copy button for the primary key of the device enrollment":::
210
210
211
211
<aid="firstbootsequence"></a>
212
212
@@ -232,7 +232,7 @@ To update and run the provisioning sample with your device information:
232
232
233
233
2. Copy the **ID Scope** value.
234
234
235
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/extract-dps-endpoints.png" alt-text="Extract Device Provisioning Service endpoint information":::
235
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/extract-dps-endpoints.png" alt-text="Screenshot showing the overview of the Device Provisioning Service instance, highlighting the ID Scope value for the instance.":::
236
236
237
237
3. In Visual Studio, open the *azure_iot_sdks.sln* solution file that was generated by running CMake. The solution file should be in the following location:
238
238
@@ -253,7 +253,7 @@ To update and run the provisioning sample with your device information:
253
253
static const char* id_scope = "0ne00002193";
254
254
```
255
255
256
-
6. Find the definition for the `main()` function in the same file. Make sure the `hsm_type` variable is set to `SECURE_DEVICE_TYPE_SYMMETRIC_KEY` as shown below:
256
+
6. Find the definition for the `main()` function in the same file. Make sure the `hsm_type` variable is set to `SECURE_DEVICE_TYPE_SYMMETRIC_KEY` as shown in the following example:
257
257
258
258
```c
259
259
SECURE_DEVICE_TYPE hsm_type;
@@ -319,15 +319,15 @@ To update and run the provisioning sample with your device information:
319
319
320
320
2. Copy the **ID Scope** value.
321
321
322
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/extract-dps-endpoints.png" alt-text="Extract Device Provisioning Service endpoint information":::
322
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/extract-dps-endpoints.png" alt-text="Screenshot showing the overview of the Device Provisioning Service instance, highlighting the ID Scope value for the instance.":::
323
323
324
324
3. Open a command prompt and go to the *SymmetricKeySample* in the cloned sdk repository:
325
325
326
326
```cmd
327
327
cd '.\azure-iot-sdk-csharp\provisioning\device\samples\how to guides\SymmetricKeySample\'
328
328
```
329
329
330
-
4. In the *SymmetricKeySample* folder, open *Parameters.cs* in a text editor. This file shows the parameters that are supported by the sample. Only the first three required parameters are used in this article when running the sample. Review the code in this file. No changes are needed.
330
+
4. In the *SymmetricKeySample* folder, open *Parameters.cs* in a text editor. This file shows the available parameters for the sample. Only the first three required parameters are used in this article when running the sample. Review the code in this file. No changes are needed.
@@ -388,7 +388,7 @@ To update and run the provisioning sample with your device information:
388
388
389
389
2. Copy the **ID Scope** and **Global device endpoint** values.
390
390
391
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Extract Device Provisioning Service endpoint information":::
391
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Screenshot showing the overview of the Device Provisioning Service instance, highlighting the global device endpoint and ID Scope values for the instance.":::
392
392
393
393
3. Open a command prompt for executing Node.js commands, and go to the following directory:
394
394
@@ -402,7 +402,7 @@ To update and run the provisioning sample with your device information:
You may comment out this code, as it is not needed with for this quick start. A custom payload would be required you wanted to use a custom allocation function to assign your device to an IoT Hub. For more information, see [Tutorial: Use custom allocation policies](tutorial-custom-allocation-policies.md).
405
+
You may comment out this code, as it's not needed with for this quickstart. A custom payload would be required you wanted to use a custom allocation function to assign your device to an IoT hub. For more information, see [Tutorial: Use custom allocation policies](tutorial-custom-allocation-policies.md).
406
406
407
407
The `provisioningClient.register()` method attempts the registration of your device.
408
408
@@ -444,18 +444,13 @@ To update and run the provisioning sample with your device information:
444
444
7. You should now see something similar to the following output. A "Hello World" string is sent to the hub as a test message.
445
445
446
446
```output
447
-
D:\azure-iot-samples-csharp\provisioning\Samples\device\SymmetricKeySample>dotnet run --s 0ne00000A0A --i symm-key-csharp-device-01 --p sbDDeEzRuEuGKag+kQKV+T1QGakRtHpsERLP0yPjwR93TrpEgEh/Y07CXstfha6dhIPWvdD1nRxK5T0KGKA+nQ==
448
-
449
-
Initializing the device provisioning client...
450
-
Initialized for registration Id symm-key-csharp-device-01.
451
-
Registering with the device provisioning service...
452
-
Registration status: Assigned.
453
-
Device csharp-device-01 registered to ExampleIoTHub.azure-devices.net.
454
-
Creating symmetric key authentication for IoT Hub...
@@ -481,7 +476,7 @@ To update and run the provisioning sample with your device information:
481
476
482
477
2. Copy the **ID Scope** and **Global device endpoint** values.
483
478
484
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Extract Device Provisioning Service endpoint information":::
479
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Screenshot showing the overview of the Device Provisioning Service instance, highlighting the global device endpoint and ID Scope values for the instance.":::
485
480
486
481
3. Open a command prompt and go to the directory where the sample file, _provision_symmetric_key.py_, is located.
487
482
@@ -578,9 +573,9 @@ To update and run the provisioning sample with your device information:
578
573
579
574
1. In the main menu of your Device Provisioning Service, select **Overview**.
580
575
581
-
2. Copy the **ID Scope** and **Global device endpoint** values. These are your `SCOPE_ID` and `GLOBAL_ENDPOINT` respectively.
576
+
2. Copy the **ID Scope** and **Global device endpoint** values. These values are your `SCOPE_ID` and `GLOBAL_ENDPOINT` parameters, respectively.
582
577
583
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Extract Device Provisioning Service endpoint information":::
578
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/copy-id-scope-and-global-device-endpoint.png" alt-text="Screenshot showing the overview of the Device Provisioning Service instance, highlighting the global device endpoint and ID Scope values for the instance.":::
584
579
585
580
3. Open the Java device sample code for editing. The full path to the device sample code is:
586
581
@@ -650,36 +645,36 @@ To update and run the provisioning sample with your device information:
650
645
651
646
3. Select the IoT hub to which your device was assigned.
652
647
653
-
4. In the **Explorers** menu, select **IoT Devices**.
648
+
4. In the **Device management** menu, select **Devices**.
654
649
655
-
5. If your device was provisioned successfully, the device ID should appear in the list, with **Status** set as *enabled*. If you don't see your device, select **Refresh** at the top of the page.
650
+
5. If your device was provisioned successfully, the device ID should appear in the list, with **Status** set as *Enabled*. If you don't see your device, select **Refresh** at the top of the page.
656
651
657
652
:::zone pivot="programming-language-ansi-c"
658
653
659
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration.png" alt-text="Device is registered with the IoT hub":::
654
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration.png" alt-text="Screenshot showing that the device is registered with the IoT hub and enabled for the C example.":::
660
655
661
656
::: zone-end
662
657
:::zone pivot="programming-language-csharp"
663
658
664
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-csharp.png" alt-text="CSharp device is registered with the IoT hub":::
659
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-csharp.png" alt-text="Screenshot showing that the device is registered with the IoT hub and enabled for the C# example.":::
665
660
666
661
::: zone-end
667
662
668
663
:::zone pivot="programming-language-nodejs"
669
664
670
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-nodejs.png" alt-text="Node.js device is registered with the IoT hub":::
665
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-nodejs.png" alt-text="Screenshot showing that the device is registered with the IoT hub and enabled for the Node.js example.":::
671
666
672
667
::: zone-end
673
668
674
669
:::zone pivot="programming-language-python"
675
670
676
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-python.png" alt-text="Python device is registered with the IoT hub":::
671
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-python.png" alt-text="Screenshot showing that the device is registered with the IoT hub and enabled for the Python example.":::
677
672
678
673
::: zone-end
679
674
680
675
::: zone pivot="programming-language-java"
681
676
682
-
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-java.png" alt-text="Java device is registered with the IoT hub":::
677
+
:::image type="content" source="./media/quick-create-simulated-device-symm-key/hub-registration-java.png" alt-text="Screenshot showing that the device is registered with the IoT hub and enabled for the Java example.":::
0 commit comments