Introduction
In my previous articles on the azure IoT series, we have learned about the Azure IoT Hub and Device Provisioning Service (DPS). If you have not read my previous articles about Azure device provisioning service yet, then please read them using the following link
As explained in the previous articles IoT devices to the IoT hub can be connected in two ways that are either using Device Provisioning Service (DPS) or directly to the IoT hub, So let's learn how to enroll the IoT devices with Device Provisioning Service (DPS).
What is Device Provisioning Service (DPS)?
Azure IoT hub device provisioning service is responsible to enroll IoT devices before devices get registered or connected on the Azure IoT hub. Devices can be directly registered with IoT hub, but Azure device provisioning service makes it easier to manage the entire life cycle of millions of IoT devices. Enrollments of devices can be done via the portal as well programmatically with the help of Azure DPS REST services or the SDK. The devices enrolled into the Azure DPS can be registered into the Azure IoT hub with the help of REST Services as well as the SDK. The following diagram will illustrate the Device Provisioning Service (DPS)

What is Device Enrollments?
Device enrollment is the process of adding the pre-configured IoT devices details on Azure device provisioning service and connect to the IoT hub on-demand or based on the requirement without any human intervention. No let's learn step by step how to enroll the IoT devices
Go to the Azure Device Provisioning
Find the device provisioning service which we have created in the Understanding The Azure IoT Hub Device Provisioning Service or if you haven't created then please follow the steps shown in the article and create it. Hope you have DPS services on the portal, Now find the option manage enrollments as shown in the following image

Using Device Provisioning Service (DPS) devices can be enrolled using the following two concepts,
- Individual Enrollment
- Group Enrollment
Add Individual Enrollment
This allows enrolling one device at a time that allows unique configuration per device. To create the individual enrollment select manage enrollment then click on Add individual enrollment as shown in the following image

After clicking on Add individual enrollment button the following screen will get appears
As shown in the preceding image, we need some details to create the enrollment entry,
- Attestation Mechanism
- Primary Certificate
- Secondary certificate
- IoT Hub Device Id
- IoT Edge Device
- Device Allocation Policy
- Choose IoT Hub
- Device Re-Provisioning
- Device Twin State
- Enable Entry








Leeladhar LadiaPosted Mar 25, 2022, 1:45 PM
Good one. Thanks
Shahriar NikkhahPosted Jan 17, 2021, 10:08 PM
Very very nice article