- Lab
- A Cloud Guru
Working with the Azure IoT Device Provisioning Service
The Device Provisioning Service allows you to deploy thousands of devices without human interaction. In this lab, we will work the the DPS and integrate it into our Azure IoT solution.
Path Info
Table of Contents
-
Challenge
Create the Azure Device Provisioning Service
-
Use Azure Cloud Shell to create the Device Provisioning Service.
-
Choose the Bash environment.
-
Select Show advanced settings.
-
Use the existing storage account that resides in the resource group location and the existing
cloudshell
file share name. -
Once in the shell, enter the following to create the IoT hub:
az iot dps create --name IoTDPS-XXXXX --resource-group <TAB> --location westus
XXXXX
is the five-character suffix for the lab resources and<TAB>
is the Tab key. Press it there to automatically populate the resource group name.
-
-
Challenge
Create Shared Access Policies in the IoT Hubs
While many tutorials state that the DPS can use the iothubowner shared access policy to link to an IoT Hub, best practice is to configure a new shared access policy with only the permissions required to link the Hub.
In the Azure Portal, navigate to iothub-XXXXX (where
XXXXX
is the five-character suffix for the lab resources) and create a new shared access policy by clicking on Shared access policy, then + Add. Create the policy with the name dps and set the following permissions:- Registry read
- Registry write
- Service connect
Repeat this procedure for iothub2-XXXXX.
-
Challenge
Link the IoT Hubs to the DPS
In order to assign devices to IoT Hubs, they must be linked to the DPS.
- In the Azure Portal, navigate to the DPS created in the first objective.
- Click on Linked IoT hubs in the DPS pane.
- Click + Add and select iothub-XXXXX from the drop-down. Click Save.
- Repeat step 3 for iothub2-XXXXX.
-
Challenge
Configure the DPS Allocation Policy
Our final requirement is to configure the DPS to assign devices to the IoT Hubs based on lowest latency.
- In the Azure Portal, navigate to the DPS created in the first objective.
- Click on Manage allocation policy in the DPS pane.
- Under Select how you want to assign devices to hubs, select Lowest latency, then click Save.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.