In this section, you use a Node.js tool called IoT Hub Explorer to create a device identity for this tutorial.
-
Run the following in your command-line environment:
npm install -g iothub-explorer@latest
-
Then, run the following command to login to your hub. Substitute
{iot hub connection string}
with the IoT Hub connection string you previously copied:iothub-explorer login "{iot hub connection string}"
-
Finally, create a new device identity called
myDeviceId
with the command:iothub-explorer create myDeviceId --connection-string
Make a note of the device connection string from the result. This device connection string is used by the device app to connect to your IoT Hub as a device.
Refer to Getting started with IoT Hub to programmatically create device identities.