Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

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.

Azure icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 45m
Published
Clock icon Jun 12, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create the Azure Device Provisioning Service

    1. Use Azure Cloud Shell to create the Device Provisioning Service.

    2. Choose the Bash environment.

    3. Select Show advanced settings.

    4. Use the existing storage account that resides in the resource group location and the existing cloudshell file share name.

    5. 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.

  2. 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.

  3. Challenge

    Link the IoT Hubs to the DPS

    In order to assign devices to IoT Hubs, they must be linked to the DPS.

    1. In the Azure Portal, navigate to the DPS created in the first objective.
    2. Click on Linked IoT hubs in the DPS pane.
    3. Click + Add and select iothub-XXXXX from the drop-down. Click Save.
    4. Repeat step 3 for iothub2-XXXXX.
  4. 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.

    1. In the Azure Portal, navigate to the DPS created in the first objective.
    2. Click on Manage allocation policy in the DPS pane.
    3. Under Select how you want to assign devices to hubs, select Lowest latency, then click Save.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans