title | description | services | author | ms.service | ms.topic | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|
include file |
include file |
iot-hub |
dominicbetts |
iot-hub |
include |
09/07/2018 |
dobett |
include file, devx-track-azurecli |
In this section, you use the Azure CLI to create a device identity for this article. Device IDs are case sensitive.
-
Open Azure Cloud Shell.
-
In Azure Cloud Shell, run the following command to install the Microsoft Azure IoT Extension for Azure CLI:
az extension add --name azure-iot
-
Create a new device identity called
myDeviceId
and retrieve the device connection string with these commands:az iot hub device-identity create --device-id myDeviceId --hub-name {Your IoT Hub name} az iot hub device-identity show-connection-string --device-id myDeviceId --hub-name {Your IoT Hub name} -o table
[!INCLUDE iot-hub-pii-note-naming-device]
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.