Azure iot tutorial

Azure IoT Hub Integration Tutorial | For Beginners Learn in 1 Day FREE

Last updated on 11th Aug 2022, Blog, Tutorials

About author

Neel Pratyush (Azure IoT Engineer )

Neel Pratyush is an Azure IoT Engineer with 6 years of experience in Microsoft Azure, IoT, embedded systems, and CyberArk. He has expertise in affiliate, pacesetting, authoritative, coercive, and laissez-faire management styles.

(5.0) | 19478 Ratings 2129

What is Azure Internet of Things (IoT)?

  • Article
  • 02/04/2022
  • 3 minutes to read
  • 10 contributors

It is a collection of Microsoft-managed cloud services that connect, monitor, and control billions of IoT assets. An IoT solution is made up of one or more IoT devices that communicate with one or more back-end services hosted in the cloud.

IoT devices:

IoT devices

An IoT device is made up of a circuit board with sensors attached that uses WiFi to connect to the internet.

For example:

  • A pressure sensor on the remote oil pump.
  • Temperature and humidity sensors in the air-conditioning unit.
  • An accelerometer in the elevator.
  • Presence sensors in the room.

There are different devices available from different manufacturers to build the solution. For a list of devices certified to work with Azure IoT Hub, the Azure Certified for IoT device catalog. For prototyping, you can use devices such as an MXChip IoT DevKit or a Raspberry Pi.

The Devkit has built-in sensors for temperature, pressure, humidity, and a gyroscope, accelerometer. The Raspberry Pi lets you attach more different types of sensor.

Microsoft offers open-source Device SDKs that can be used to build the apps that run on the devices. These SDKs simplify and accelerate the development of the IoT solutions.


IoT devices send telemetry from the sensors to back-end services in the cloud. The other types of communication are possible such as a back-end service sending commands to devices.

The following are examples of device-to-cloud and cloud-to-device communication:

  • A mobile refrigeration truck sends temperature every 5 minutes to the IoT Hub.
  • The back-end service sends a command to a device to modify the frequency at which it sends telemetry to help diagnose a problem.
  • A device sends notifications based on the values read from its sensors.
  • For example, a device monitoring a batch reactor in a chemical plant, sends an alert when the temperature exceeds a certain value.
  • Devices send information to show on a dashboard for viewing by human operators.
  • For example, a control room in a refinery may display the temperature, pressure, and flow volumes in each pipe, enabling operators to monitor the facility.

The IoT Device SDKs and IoT Hub support common communication protocols like HTTP, MQTT, and AMQP. IoT devices have various characteristics when compared to other clients such as browsers and mobile apps.

The device SDKs help to address the challenges of connecting devices securely and reliably to back-end service. Specifically, IoT devices.

  • Are often embedded systems with no human operator .
  • Can be deployed in remote locations, where physical access is costly.
  • May only be reachable by the solution back end.
  • May had limited power and processing resources.
  • May had intermittent, slow, or expensive network connectivity.
  • May require to use proprietary, custom, or industry-specific application protocols.

Back-end services

In an IoT solution, the back-end service provides functionality are:

  • Receiving telemetry at scale from the devices, and determining how to process and save that data.
  • Analyzing the telemetry to provide insights, in real time or after the fact.
  • Sending commands from the cloud to the specific device.
  • Provisioning devices and controlling which devices can connect to the infrastructure.
  • Controlling the state of the devices and monitoring their activities.
  • Managing the firmware installed on the devices.

For example, in a remote monitoring solution for an oil pumping station, the cloud back end uses telemetry from the pumps to find anomalous behavior.

When the back-end service finds an anomaly, it can automatically send a command back to the device to take a corrective action. This process creates an automated feedback loop between the device and the cloud that increases the solution efficiency.

Azure IoT examples

For real-life examples of how enterprises use Azure IoT, see Microsoft Technical Case Studies for IoT.

Azure IoT technologies and services

For simple onboarding, start as high as can with Azure IoT Central, an application platform as a service (aPaaS).

  • Starting here, easy connectivity and management of IoT devices, and extensibility features help to integrate your IoT data into business applications to deliver proof of value.
  • If requirements go beyond IoT Central’s capabilities, the Azure portfolio encourages to go lower in the stack.
  • Customizable platform as a service (PaaS) providers such as Azure IoT Hub and the Azure IoT device SDKs enable custom IoT solutions from scratch.
Azure IoT Central (aPaaS):
  • The IoT Central application platform is a ready-made environment for the IoT solution development.
  • Built on trusted Azure PaaS services it decreases the burden and cost of developing, managing, and maintaining enterprise-grade IoT solutions.
  • It delivers built-in disaster recovery, multitenancy, global availability, and the predictable cost structure.
  • IoT Central’s customizable web UI and API surface let monitor and manage millions of devices and their data throughout the life cycle.
  • Get started exploring IoT Central in minutes using a phone as an IoT device – see live telemetry, make rules, run commands from the cloud, and export the data for business analytics.
  • Choose devices from the Azure Certified for IoT device catalog to fastly connect to solution, or develop a custom device using IoT Central’s device templates.

How does Azure IoT work?

Azure IoT Hub is a maintained service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices.

Also can connect millions of devices and their backend solutions reliably and confidentially. Moreover any device can be connected to an IoT hub.

IoT concepts and Azure IoT Hub

The Internet of Things (IoT) is a network of physical devices that connect to and exchange the data with other devices and services over the Internet. There are currently over 10 billion connected devices in the world and more are added every year.

Anything that can be embedded with the necessary sensors and software can be connected to the internet. It is a managed service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices.It can also connect millions of devices and their backend solutions reliably and securely.

Almost any device can be connected to an this. Several messaging patterns are supported, including device-to-cloud telemetry, uploading files from devices, and request-reply methods to control the devices from the cloud.

It also supports screening to help track device creation, device connections, and device failures.It scales to millions of simultaneously connected devices and millions of events per second to support IoT workloads. It can integrate IoT Hub with other Azure services to built complete, end-to-end solutions. For example, use:

  • Azure Event Grid to enable the business to react rapidly to critical events in a reliable, scalable, and secure manner.
  • Azure Logic Apps to automate the business processes.
  • Azure Machine Learning to add machine learning and AI models to the solution.
  • Azure Stream Analytics to run real-time analytic computations on the data streaming from the devices.


  • Develop IoT devices using a starter kit like Azure MXChip IoT DevKit or choose a device from the Azure Certified for IoT device catalog.
  • Implement the embedded code by using the open-source device SDKs.
  • The device SDKs support more operating systems, like Linux, Windows, and real-time operating systems.
  • There are SDKs for multiple programming languages, like C, Node.js, Java, .NET, and Python.
  • To further simplify how to create the embedded code for the devices, follow the IoT Plug and Play conventions.
  • At the core of IoT Plug and Play, is a device capability model schema that explains device capabilities.
  • Use the device capability model to configure a cloud-based solution like an IoT Central application.
  • Azure IoT Edge lets offload parts of the IoT workload from the Azure cloud services to devices.
  • IoT Edge can reduce latency in solution, reduce the amount of data that devices exchange with the cloud, and enable off-line scenarios.
  • Can maintain IoT Edge devices from IoT Central.
  • Azure Sphere is a secured, high-level application platform with built-in communication and security for internet-connected devices.
  • It consists a secured microcontroller unit, a custom Linux-based operating system, and cloud-based security service that offers continuous, renewable security.

Device properties:

Properties can be read or set from the IoT hub and can be used to send notifications when an action has finished. An example of a particular property on a device is temperature.

Temperature can be writable property that can be updated on the device or read from the temperature sensor attached to the device. It can enable properties in IoT Hub by using Device twins or Plug and Play.

Cloud connectivity:

The Azure IoT Hub service provide reliable and secure bi directional communications between millions of IoT devices and a cloud-based solution. Azure IoT Hub Device Provisioning Service is a helpful service for IoT Hub.

The service offers zero-touch, just-in-time provisioning of devices to the right IoT hub without need human intervention. These capabilities provide customers to provision millions of devices in a secure and scalable manner.

IoT Hub is a core component, and can use it to meet IoT implementation challenges are:

  • More -volume device connectivity and management.
  • More -volume telemetry ingestion.
  • Command and control of the devices.
  • The Device security enforcement.

Data and analytics:

IoT devices Create large amounts of time series data, such as temperature readings from sensors. Azure Time Series Insights can connect to an IoT hub, read the telemetry stream from the devices, save that data, and enable to query and visualise it.

Azure Maps is a collection of geospatial services that use fresh mapping data to provide correct geographic context to web and mobile applications. Also can use a REST API, a web-based JavaScript control, or an Android SDK to build the applications.

Built-in endpoint collects device data by default:

A built-in endpoint gather data from the device by default. The data is collected using a request-response pattern dedicated IoT device endpoints, is available for a maximum period of seven days, and can be used to take actions on a device.

Here is the data accepted by the device endpoint are:

  • Send device-to-cloud messages.
  • Receive cloud-to-device messages.
  • Initiate file uploads.
  • Retrieve and update device twin properties.
  • Receive direct method requests.

Are you looking training with Right Jobs?

Contact Us

Popular Courses