| title | Azure IoT Hub device-to-cloud options | ||||
|---|---|---|---|---|---|
| description | This article provides guidance on when to use device-to-cloud messages, reported properties, or file upload for cloud-to-device communications. | ||||
| author | cwatson-cat | ||||
| ms.author | cwatson | ||||
| ms.service | azure-iot-hub | ||||
| ms.topic | concept-article | ||||
| ms.date | 05/22/2025 | ||||
| ms.custom |
|
This article helps you choose the appropriate device-to-cloud communication option in Azure IoT Hub based on your scenario requirements. IoT Hub supports three primary options for device-to-cloud communication: device-to-cloud messages, device twin's reported properties, and file uploads.
IoT Hub exposes three options for sending information from the device app to the solution back end:
-
Device-to-cloud messages for time series telemetry and alerts.
-
Device twin's reported properties for reporting device state information such as available capabilities, conditions, or the state of long-running workflows. For example, configuration and software updates.
-
File uploads for media files and large telemetry batches uploaded by intermittently connected devices or compressed to save bandwidth.
[!INCLUDE iot-hub-basic]
The following table compares the various device-to-cloud communication options in IoT Hub based on common factors.
| Factor | Device-to-cloud messages | Device twin's reported properties | File uploads |
|---|---|---|---|
| Scenario | Telemetry time series and alerts. For example, 256-KB sensor data batches sent every 5 minutes. | Available capabilities and conditions. For example, the current device connectivity mode such as cellular or WiFi. Synchronizing long-running workflows, such as configuration and software updates. | Video or other large media files. Large (typically compressed) telemetry batches. |
| Storage and retrieval | Temporarily stored by IoT Hub, up to seven days. Only sequential reading. | Stored by IoT Hub in the device twin. Retrievable using the IoT Hub query language. | Stored in user-provided Azure Storage account. |
| Size | Up to 256-KB messages. | Maximum reported properties size is 32 KB. | Maximum file size supported by Azure Blob Storage. |
| Frequency | High. For more information, see IoT Hub quotas and throttling. | Medium. For more information, see IoT Hub quotas and throttling. | Low. For more information, see IoT Hub quotas and throttling. |
| Protocol | Available on all protocols. | Available using MQTT or AMQP. | Available when using any protocol, but requires HTTPS on the device. |
An application might need to send information both as a telemetry time series or alert and make it available in the device twin. In this scenario, you can choose one of the following options:
- The device app sends a device-to-cloud message and reports a property change.
- The solution back end can store the information in the device twin's tags when it receives the message.
Since device-to-cloud messages enable higher throughput than device twin updates, it's sometimes desirable to avoid updating the device twin for every device-to-cloud message.