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

Configure and Connect an Azure IoT Device Simulator

Who needs physical devices? In this lab, you will configure, modify, and test a software solution that simulates the hardware and firmware of an IoT device. Then, you will be able to practice building Azure IoT solutions — even if you don’t have a wind farm or a global network of climate-controlled warehouses at your disposal!

Azure icon

Path Info

Clock icon Beginner
Clock icon 30m
Clock icon Feb 25, 2022

Contact sales

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

Table of Contents

  1. Challenge

    Create and Connect Simulated Device to Azure IoT Hub

    1. Log in to the Azure portal, and navigate to the only IoT Hub already deployed in the lab subscription.
    2. Create a new device, and copy the primary connection string.
    3. Using the link in the Resources section of the lab, open the device simulator in a new browser tab or window.
    4. In the code pane, find and modify the connection string using the primary connection string you copied from the new device registration.
    5. Run the code and observe changes in the telemetry messages. Don't forget to take note of the light flashing on the device simulator in the assembly pane when each message is delivered — that's half the fun!
    6. Stop to end the code run.
  2. Challenge

    Make Minor Changes to Simulator Code

    1. In the code pane of the device simulator, find the code that makes up the body of the message.
    2. Modify the temperature telemetry to return the temperature in Fahrenheit instead of Celsius.
    3. Run the code and observe changes in the telemetry messages.
    4. Stop to end the code run.
    5. In the same section of the code, add a barometer reading using a reading called pressure_hPa.
    6. Run the code, and observe changes in the telemetry messages.
    7. Stop to end the code run.
  3. Challenge

    Confirm Delivery of Messages in Azure IoT Hub

    1. Back in the Azure Portal subscription, return to the IoT Hub, and view the Device to cloud messages graph. Expand the graph to ensure you can see the full day. You should see at least a few messages generated from activities in the first 2 objectives.

    2. To view the actual messages, which have been routed to a storage container, navigate to the only storage account deployed into the lab subscription. Drill down in the blob container to find the delivered messages.

      Note: If you work especially fast, you may need to wait a few minutes for the messages to appear in the graph and in the blob container.

    3. Optionally, download a blob to open and view the telemetry.

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