Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Registering a Device with Azure IoT Hub

An Azure IoT Hub by itself isn't much of an IoT solution. As a matter of fact, it isn't one at all. Without devices to send telemetry to the IoT hub, the hub itself is like an ice cream shop with zero flavors. In this hands-on lab, we will create a device in a pre-provisioned Azure IoT hub and then, using a Raspberry Pi simulator, connect that device to our IoT hub. We will then be able to see connectivity between the device and our hub.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Aug 20, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Register the Device with the IoT Hub
    1. Access the CLI by using Azure Cloud Shell, logging in with the credentials provided in the lab.

    2. Click the Cloud Shell icon (>_) in the upper-right of the screen.

    3. Click Bash.

    4. Click Show advanced settings, and set the following values:

      • Subscription: Leave default
      • Resource group: Use Existing
      • Cloud Shell region: Use the same region as your lab provided storage account.
      • Storage account: Use existing
      • File share: Create new, and enter cloudshell
    5. Click Create storage.

    6. Install the Azure IoT extension for CLI:

      az extension add --name azure-iot
      
    7. Register the device (XXXXX is the five-character suffix for the lab resources):

      az iot hub device-identity create --device-id IoTDevice1 --hub-name iothub-XXXXX
      
    8. Obtain the connection string for the device (XXXXX is the five-character suffix for the lab resources):

      az iot hub device-identity connection-string show --hub-name iothub-XXXXX --device-id IoTDevice1 --output table
      
    9. Copy this connection string to your clipboard.

  2. Challenge

    Configure the Raspberry Pi Azure IoT Online Simulator
    1. Access the simulator at https://azure-samples.github.io/raspberry-pi-web-simulator/.

    2. Change the following line (line 15), replacing the text between the single quotes with the connection string you copied in the previous objective:

      const connectionString = '[Your IoT hub device connection string]';
      
  3. Challenge

    Verify Connectivity to the IoT Hub

    In the Raspberry Pi Azure IoT Online Simulator, click Run. If the previous objective was performed correctly, the "LED" light will blink, and you should see messages from the "device" being sent to the IoT hub, like so:

    IoT Device Connected!

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

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.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight