Device registration

Devices should be registered before they can send messages to an IoT Hub. Registration of devices can be done manually using the Azure portal or can be automated using the IoT Hub SDK. Azure provides sample simulation applications, with the help of which it becomes easy to register virtual devices for development and testing purposes. There is also a Raspberry Pi online simulator that can be used as a virtual device, and then, obviously, there are other physical devices that can be configured to connect to the IoT Hub.

If readers want to simulate a device from a local PC generally used for development and testing purposes, there are tutorials available in the Azure documentation in multiple languages. They are available at https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-get-started-simulated.

The Raspberry Pi online simulator is available at https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-raspberry -pi-web-simulator-get-started, and for using physical devices to be registered with IoT Hub, the steps mentioned at https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-get-started-physical should be used.

For manually adding a device using the Azure portal, IoT Hub provides a Device Explorer menu, which can be used for configuring a new device:

After the device identity is created, a primary key connection string for IoT Hub should be used in each device to connect to it: