Create Azure IoT Hubs by Two Different Methods

45 minutes
  • 2 Learning Objectives

About this Hands-on Lab

The Azure Internet of Things (IoT) is a collection of Microsoft-managed cloud services that connect, monitor, and control billions of IoT assets. All IoT solutions require a cloud gateway for communication between devices and backend cloud services. Azure’s cloud gateway is called IoT Hub. In this lab, you will have the opportunity to practice the task of creating an IoT hub. You are provided with a set of basic criteria, and you are asked to create 2 IoT hubs that are configured to meet those criteria. After completing this lab, you will be familiar with creating IoT hubs in the Azure portal and with the Azure CLI, and you will be ready to proceed to more complex topics.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create Azure IoT Hub #1

See the Additional Resources section of this lab to read the context and technical requirements for this hub.

  1. Log in to the Azure portal, in anInPrivate or incognito window, using the credentials provided with this lab.
  2. Take note of the location of the resource group automatically created for you in the lab environment
  3. Navigate the portal to begin creating a new Azure IoT Hub.
  4. Once in the Hub creation forms, use the lab-defined subscription and resource group already created.
  5. For Region, use the same location as the resource group location you noted in the second step, above.
  6. Give your hub a universally unique name. See the Additional Resources section for tips on naming.
  7. When prompted, choose Public Endpoint (All Networks), versus private.
  8. Select the correct Pricing and scale tier to fulfill the requirements described in the Additional Resources section of this lab. Do not use the Free tier. Choose between Standard and Basic.
  9. Set IoT hub units to the number of units that will fulfill the requirements described in the Additional Resources section of this lab.
  10. Enable Defender for IoT .
  11. Review your settings and create the hub, confirming that it deployed successfully. (This may take a few minutes.)
Create Azure IoT Hub #2

See the Additional Resources section of this lab to read the context and technical requirements for this hub.

  1. Remain in the Azure portal or return to the portal, in an in-private or incognito window, using the credentials provided with this lab.
  2. Take note of the location of the resource group automatically created for you in the lab environment.
  3. Copy the name of the resource group for the lab into a text document for use in creating the hub.
  4. Open the Cloud Shell terminal window within the Azure portal.
  5. Click Bash and then Show advanced settings
  6. Leave defaults in place or choose the 1 available resource for Subscription, Resource group, and Region
  7. Create a universally unique name for Storage account. See the Additional Resources section for tips on naming.
  8. For File share, enter cloudshell.
  9. Once in the shell, confirm that you are using Bash and not PowerShell.
  10. Using the Azure CLI, execute a command to create a uniquely named hub in the same resource group and region as your first hub. Also, ensure the hub is set up with the correct SKU (tier and edition) and scale units required to fulfill the requirements described in the Additional Resources section of this lab. Do not use the Free tier. Choose between Standard and Basic. See links in the Additional Resources for the Azure CLI reference and hub SKU calculations.
  11. Once the deployment is complete in the terminal, go back to the resource group Overview page in the portal to confirm that you now have 2 hubs created. (You may need to refresh.)

Additional Resources

Imagine you are a software engineering team lead for the Green River Railway company. You've been tasked with prototyping a project to demonstrate how data from existing weather devices along the rail lines can be integrated into the company's logistics planning software.

Your current task is to create 2 IoT hubs with various settings in order to develop a proof-of-concept solution.

Create 2 IoT hubs that meet the provided criteria. Create the first IoT hub using the Azure portal. Create the second IoT hub using Azure CLI in Cloud Shell.

IoT Hub 1

This hub, created in the Azure portal, will be used for two-way communication between the hub and devices, including cloud-to-device commands and device management tasks. The devices connected to this hub will send and receive about 350,000 messages per day. The service tier, edition, and units you choose when deploying your hub must meet these criteria in order to avoid throttling issues down the road — but also at the lowest possible cost. The name of your hub must be universally unique. One of the best ways to ensure this is to use the generated random characters that show in the name of the resource group created when you launched this lab.

IoT Hub 2

This hub, created in the Azure portal, will be used for device-to-cloud telemetry only. It will not be required to send cloud-to-device commands or other similar management tasks. The connected devices are simple but will eventually be sending millions of messages a day. However, for proof-of-concept purposes, we will only have 1 or 2 devices connected, sending 1 message every 30 seconds. The service tier, edition, and units you choose when deploying your hub must meet the proof-of-concept criteria in order to avoid throttling issues down the road — but also at the lowest possible cost. The name of your hub must be universally unique. One of the best ways to ensure this is to use the generated random characters that show in the name of the resource group created when you launched this lab.

Additional Documentation

WARNING: Be Prepared for UI Changes

Given the fluid nature of Microsoft cloud tools, you may experience user interface (UI) changes that were made following the development of this hands-on lab that do not match up with lab instructions. When any such changes are brought to our attention, we will attempt to update the content accordingly. However, if changes occur, students will have to adapt to the changes and work through them in the hands-on labs as needed.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?