Azure IoT Devices
This section provides comprehensive documentation for developing, provisioning, managing, and securing IoT devices that connect to Azure IoT services.
Device Provisioning
Learn how to securely and efficiently provision your IoT devices at scale using Azure IoT Hub Device Provisioning Service (DPS). This service enables zero-touch provisioning, allowing devices to be automatically registered and configured with IoT Hub upon their first connection.
- Get started with DPS
- Enrollment groups and individual enrollments
- Device attestation mechanisms
- Provisioning to multiple IoT hubs
Device Management
Manage the lifecycle of your IoT devices effectively. This includes monitoring device health, deploying updates, configuring devices remotely, and handling disconnections.
Key features
- Device twins: Maintain device state and desired properties.
- Direct methods: Invoke commands on devices in real-time.
- Device jobs: Schedule and manage jobs for device configuration and updates.
- Monitoring: Track device connectivity and performance.
Device Authentication
Securely authenticate your devices to Azure IoT Hub. Azure IoT Hub supports multiple authentication methods to ensure that only authorized devices can connect to your IoT solution.
Supported methods
- X.509 certificates: Self-signed or CA-signed certificates for robust security.
- Shared Access Signatures (SAS): Token-based authentication for simpler scenarios.
- JSON Web Tokens (JWT): For integration with Trusted Platform Modules (TPMs) or other hardware security modules.
Choosing the right authentication method depends on your device's capabilities and security requirements.
Device SDKs
Azure provides Software Development Kits (SDKs) for various platforms and languages to simplify device development. These SDKs handle communication protocols, authentication, and data telemetry.
Available SDKs
- Azure IoT SDK for C
- Azure IoT SDK for Python
- Azure IoT SDK for Java
- Azure IoT SDK for .NET
- Azure IoT SDK for Node.js
Refer to the respective SDK documentation for installation, usage, and examples.
Device Twins
Device twins are JSON documents that represent the state of a device. They contain two key parts: tags (metadata) and properties (reported and desired). Tags are immutable after creation, while properties can be updated.
Properties
- Desired Properties: Set by the cloud application to configure device settings or desired states.
- Reported Properties: Reported by the device to reflect its current state or reported settings.
Device twins enable bidirectional communication and synchronization between the cloud and devices, facilitating effective device management and control.
// Example of a device twin JSON document
{
"deviceId": "my-iot-device-01",
"etag": "AAAAAAAAAAE=",
"version": 2,
"properties": {
"desired": {
"telemetryInterval": 60,
"firmwareVersion": "1.2.0",
"$metadata": { ... },
"$version": 1
},
"reported": {
"telemetryInterval": 60,
"batteryLevel": 95,
"firmwareVersion": "1.2.0",
"connectivity": {
"type": "wifi",
"signalStrength": 80
},
"$metadata": { ... },
"$version": 2
}
},
"tags": {
"location": "building-a",
"floor": "2"
}
}