Introduction
In my last article, we learned about the Azure device provisioning service, which allows us to manage IoT devices. If you have not read my previous article about Azure device provisioning service yet, then please read it using the following link.
Understanding The Azure IoT Hub Device Provisioning Service
Now we have a platform to manage the IoT devices, but what about connecting the devices to some platform and getting the data from those connected devices? We must connect the device to some gateway platform to establish a secure connection between the cloud and the device to exchange the data. So, in this article, we will learn about the Azure IoT hub and the role of the IoT Hub in managing the IoT device's communication and telemetry data, that is messages.
What is IoT?
IoT Stands for Internet of Things, which is a network of internet-connected hardware devices that give some insightful information about things such as a car, bike, truck, factory, etc.
What is the use of IoT?
You might have heard the words digital and smart multiple times such as digital services or smart cities etc. A real-world example is Indian Prime Minister Narendra Modi who always talks about digital India and smart cities.
So, what does digital mean? Simply the access of the services to an individual over the internet in the form of web applications, mobile applications, etc. which helps to minimize the presence of humans at particular facilities in order to get work done from the location where the person resides with the help of mobile apps or web applications.
A smart city is also a part of a digital service in which citizens can see the temperature and humidity of their cities and it automatically generates alerts to their citizens regarding sudden changes in the environment and specific precautions to take. Citizens can even track the live location of specific bus routes so he or she can plan accordingly. Streetlight management is another example of a smart city service in which streetlights are automatically managed by a digital service that is responsible for turning on or off lights based on surrounding visibility and generates alerts if any light bulb has a problem, so servicemen can fix it immediately.
The preceding scenarios are just a few examples:
Benefits of IoT
Consider just one of the scenarios that I have explained in the preceding paragraphs, let’s assume we have implemented smart streetlight management using IoT, the benefits are:
- Monitor the network of streetlights in one place using the web application or mobile application.
- Turn the lights on or off automatically based on the surrounding visibility such as sunrise and sunset which help to save a huge amount of electricity consumption.
- Consider some lights are turned off due to some problem, then IoT generates an alert with details which helps servicemen to fix it immediately without going in person at sites.
By considering just a few examples above, you can imagine how IoT helps to give meaning to things that save time, cost, and effort. The IoT will play a very important role in shaping the future of the world. In the coming years, we will see the IoT in everything, which will make human life much easier and faster.
How does IoT work?
To understand how IoT works, understand the following basic terminology of IoT.
- Things
- Device
- Sensor
- Network
- IoT Gateway
- Communication Protocol
Things
Any object around us that we use in our daily life such as a car, truck or any vehicle, water taps, pumps, machines, house, factory or room, AC, fan, etc.
Device
This is the hardware installed on the things to get the data.
Sensor
The sensor is situated on the device to monitor the intended information such as temperature, speed, humidity, visibility, etc.
Examples
- Temperature and humidity sensor
- Pressure sensor
- Visibility sensor
- Magnetometer sensor
- Accelerometer sensor
Network
This is the way of communicating how device sensors and data collection platforms are connected to each other, such as Bluetooth, LAN, Wi-Fi, WAN, Internet, etc.
IoT Gateway
The IoT gateway is the platform or mediator between devices to cloud or cloud-to-device communication which is responsible for collecting the messages from IoT devices and sending messages back to the devices.
The IoT gateway provides the features to collect and process the IoT device's data and upgrade the IoT devices. The most common example of an IoT gateway is Microsoft Azure IoT.
Communication Protocol
The communication protocols are the medium that is responsible for establishing the communication between IoT devices and IoT gateways to send and receive messages between them.
Examples of the most common protocols are.
- AMQP
- MQTT
- HTTPS
- TCP
- UDP
- DDS
- XMPP
- LwM2M
- ZigBee

Now we have seen what IoT is in brief and the advantages it gives. We can achieve these preceding scenarios with the help of Microsoft Azure IoT. Let’s see about Azure IoT.
What is Microsoft Azure IoT?
Azure IoT is the IoT gateway for IoT devices which allows bi-directional communication between IoT devices to the cloud and cloud to IoT devices. Azure IoT can process millions of IoT devices and route the messages to specific data storage platforms.
Key Advantages of Azure IoT
- Built-in UI to manage and monitor the IoT devices.
- Allows us to capture entire device lifecycle events using the device life cycle change event feature.
- Allows us to upgrade the firmware of single or bulk devices using the automatic device management feature.
- Allows the bi-directional communication between IoT devices to the cloud and cloud to IoT devices.
- The IoT hub allows us to connect the edge devices and IoT devices which means the IoT hub is capable of connecting low-powered and high-processing devices.
- IoT devices can send telemetry data as well as connect devices over a network using AMQP, MQTT, and HTTPS protocol to the Azure IoT hub.
- Azure IoT hub supports a wide range of IoT device authentication mechanisms such as X509, tpm, and symmetric keys.
- Azure IoT hub allows routing the messages to the specific data store and data process platform using the message routing feature.
- Azure IoT hub allows uploading the file for a specific device which can be used for device upgradation for storing device process-related information.
- Azure IoT hub allows us to send commands to the device which can help to change the behavior of the device using the Cloud to Device message feature.
- Provides the device twin feature to store the metadata or any specific information about the IoT devices.
- Azure IoT hub is supposed to be a secure platform for communication and authentication for the devices with the help of communication protocol AMQP, MQTT, and HTTPS and authentication mechanisms such as X509, TPM, and symmetric key.
- Provides a wide range of SDK that helps to connect to the IoT hub and devices programmatically C#, java, python, C, Node.js, and android SDK also IoT hub supports API.
- Provides the feature to enable or disable the connected IoT devices.
Now let's learn more about the Azure IoT hub.
Creating an Azure IoT hub using Azure Portal
Azure IoT Hub can be created using.
- Azure CLI
- SDK
- API
- ARM
- Azure portal
In this article, we will be creating an IoT hub using the portal so we can avoid confusion for beginners. Now let’s start creating the Azure IoT hub step-by-step via the Azure portal.












Join the conversation! Your thoughts help the community grow.