Azure IoT Hub Architecture
Understand the core components and design principles that make Azure IoT Hub a robust and scalable platform for connecting, monitoring, and managing billions of IoT devices.
Conceptual diagram of Azure IoT Hub's high-level architecture.
Core Components
Azure IoT Hub is designed as a highly available, globally distributed, managed service. It facilitates secure bidirectional communication between IoT devices and cloud services.
Device Identity Registry
The identity registry is a secure store within IoT Hub that manages the identity of each device connected to your solution. It supports:
- Device Identities: Unique identifiers for each device.
- Authentication: Supports symmetric keys, X.509 certificates, and Trusted Platform Modules (TPMs) for secure device authentication.
- Authorization: Manages permissions for devices accessing IoT Hub endpoints.
Message Routing
IoT Hub enables flexible and scalable routing of device-to-cloud (D2C) messages to various Azure services. Key aspects include:
- D2C Messaging: Devices send telemetry data and events to IoT Hub.
- Message Endpoints: Default endpoints include the service-side endpoint for device-to-cloud messages. You can also configure custom endpoints.
- Message Routing Rules: Define rules based on message properties and content to direct messages to specific endpoints, enabling conditional routing and data filtering.
Device Twins
Device twins are JSON documents representing the state of a device. They exist on the service side and mirror the state of a physical device. They consist of:
- Desired Properties: Set by the cloud backend to configure device settings or desired states.
- Reported Properties: Reported by the device to indicate its current status or state.
- Tags: Metadata used for device querying and management.
Cloud-to-Device (C2D) Messaging
IoT Hub supports sending commands and messages from the cloud backend to devices. This includes:
- Direct Methods: For immediate, synchronous invocation of device functionality.
- C2D Messages: For asynchronous communication, allowing devices to receive messages and acknowledge them.
- Message Delivery Guarantees: Supports at-least-once delivery.
Device Management
IoT Hub provides capabilities for managing devices at scale:
- Device Provisioning: Supports bulk creation and deletion of device identities.
- Device Updates: While not directly managed by IoT Hub, it integrates with services like IoT Hub Device Provisioning Service (DPS) and Azure Device Update for IoT Hub.
- Device Grouping and Querying: Using device twins and tags to group and query devices for targeted management operations.
Key Architectural Principles
IoT Hub is built on several fundamental principles to ensure its effectiveness:
- Scalability: Designed to handle millions of devices and billions of messages per day.
- High Availability: Operates as a globally distributed service with automatic failover.
- Security: Employs robust security measures for device authentication and communication.
- Interoperability: Supports various device SDKs and protocols (MQTT, AMQP, HTTPS).
- Extensibility: Integrates seamlessly with other Azure services for data processing, analytics, and storage.
Secure Bidirectional Communication
IoT Hub ensures that communication between your devices and your cloud solution is secure. Devices are authenticated using industry-standard security credentials, and all communication is encrypted using TLS.
Integration with Other Azure Services
IoT Hub is a central piece of the Azure IoT ecosystem. It integrates tightly with:
- Azure IoT Hub Device Provisioning Service (DPS): For zero-touch, just-in-time provisioning of IoT devices.
- Azure Stream Analytics: For real-time data processing and analysis of telemetry.
- Azure Blob Storage, Azure Data Lake Storage, Azure Cosmos DB: For storing and managing large volumes of IoT data.
- Azure Functions, Azure Logic Apps: For building serverless event-driven applications in response to IoT data.
- Azure Time Series Insights: For visualizing and analyzing time-stamped IoT data.
- Azure Active Directory (Azure AD): For managing access and permissions to IoT Hub and other Azure resources.