Every IoT hub has an identity registry that stores information about the devices that are permitted to connect to it. Before a device can connect to an IoT hub, there must be an entry for that device in the IoT hub’s identity registry. A device must also authenticate with the IoT hub based on credentials stored in the identity registry.
In this task, you will register your MXChip AZ3166 device with your IoT Hub.
- Ensure that you have the GetStarted sample open in Visual Studio Code and that your MXChip AZ3166 device is connected to your PC.
- In the Visual Studio Code window, press Ctrl + P.
- At the prompt, to select the task that will provision your device, type task c and then click cloud-provision
- When prompted within the command line instructions, select the Azure subscription that you are using, and then press Enter The provisioning process will then check your subscription for an IoT Hub that it can use.
- When prompted within the command line instructions, select the IoT Hub that you created earlier, and then press Enter. You should see an option to select the hub that you created.
- When prompted that the provisioning process is complete, press Enter. You device, which has been named AZ3166, has now been registered with your IoT Hub. You can open you Azure portal to verify that it was created.
- Open a browser window and navigate to your Azure portal.
- On your dashboard, use your Resources tile to open your IoT Hub. Click the IoT Hub resource to open it.
- On the Overview blade, notice that the IoT Hub Usage tile now indicates that you have 1 IoT Device.
- On the left-side menu, click *IoT devices.
- Notice that a device has been created with the device ID set to “AZ3166”.