IoT Hub Concepts
Azure IoT Hub is a fully managed service that enables reliable and bi-directional communications between millions of Internet of Things (IoT) devices and an Azure solution backend. It can securely connect, monitor, and manage IoT devices at scale.
Key Features and Benefits
- Device Connectivity: Securely connect diverse devices using industry-standard protocols like MQTT, AMQP, and HTTPS.
- Device Identity Management: Manage unique identities for each connected device, ensuring secure authentication and authorization.
- Bi-directional Communication: Support for both device-to-cloud (telemetry) and cloud-to-device (commands, desired properties) messaging.
- Scalability: Designed to handle millions of devices and billions of messages.
- Device Management: Capabilities for device provisioning, monitoring, updates, and maintenance.
- Integration: Seamless integration with other Azure services like Azure Functions, Azure Stream Analytics, Azure Cosmos DB, and Azure Machine Learning.
Core Components
Device Identity Registry
The device identity registry stores information that identifies and secures each IoT device that connects to IoT Hub. Each device identity has a unique device ID, authentication credentials (symmetric keys or X.509 certificates), and an application-specific metadata property.
{
"deviceId": "my-sensor-123",
"generationId": "1234567890ABCDEF",
"etag": "AAAAAAAAH8=",
"connectionState": "Disconnected",
"lastActivityTime": "2023-10-27T10:00:00Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
"x509Thumbprint": {
"primaryThumbprint": null,
"secondaryThumbprint": null
},
"status": "enabled",
"statusReason": null,
"statusUpdateTime": "2023-10-27T09:00:00Z",
"connectionTags": {},
"capabilities": {
"iotEdge": false
},
"deviceEtag": "NTY0OTU3MDYw",
"version": 4,
"properties": {
"desired": {
"temperatureUnit": "celsius",
"$version": 1
},
"reported": {
"firmwareVersion": "1.0.2",
"$version": 2
}
}
}
Device Twins
A device twin is a JSON document that represents a device's state, including its metadata, configuration, and the state of its reported properties. It provides a reliable way to synchronize device state and configurations between devices and the cloud.
Note: Device twins are crucial for managing device configurations and monitoring device health.
Messaging
IoT Hub supports three types of messaging:
- Device-to-cloud telemetry: Devices send telemetry data (e.g., sensor readings) to the cloud.
- Cloud-to-device commands: The cloud sends commands to devices (e.g., reboot, change settings).
- Cloud-to-device desired properties: The cloud can update desired properties on a device, which the device can then acknowledge.
Getting Started
To begin using Azure IoT Hub, you'll need to create an IoT Hub instance in your Azure subscription. You can then register devices and use the Azure IoT SDKs to connect and communicate with your devices.
Explore the Quickstarts section for step-by-step guides to set up your first IoT solution.