Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.18 KB

iot-hub-get-started-create-device-identity.md

File metadata and controls

34 lines (25 loc) · 1.18 KB
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.

  1. Open Azure Cloud Shell.

  2. In Azure Cloud Shell, run the following command to install the Microsoft Azure IoT Extension for Azure CLI:

    az extension add --name azure-iot
    
  3. 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.