How does IoT Hub store retained device-to-cloud messages in the Event Hub-compatible endpoint? Is it stored in memory or disk?

Hitesh Agarwal 0 Reputation points
2025-01-31T11:24:03.05+00:00

I am working with Azure IoT Hub and using the built-in Event Hub-compatible endpoint for device-to-cloud (D2C) messages. I have the following questions regarding the retention and storage mechanism of these message:

Temporary Retention: If a device sends telemetry data (messages) to IoT Hub and the messages are not consumed immediately, how are they stored during the retention period (up to 7 days)? Are these messages stored in memory (RAM) or persistent disk storage (SSD/HDD), or is there a combination of both?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,235 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 34,766 Reputation points MVP
    2025-01-31T12:06:04.3566667+00:00

    Hello @Hitesh Agarwal,

    welcome to this moderated Azure community forum.

    The Azure IoT Hub is a PaaS service for ingesting telemetry from many devices, each having its own identity.

    Incoming messages are routed to other Azure services via either the 'eventhub compatible' endpoint, the more advanced routes (including message enrichment), or the connection via an EventGrid.

    Incoming messages are stored up to 7 day before deletion, depending on the configuration.

    This storage is handled by the IoT hub itself so its not documented how the internal storage works.

    Personally, I expect a combination of Azure storage queue, blobs or tables. But with the availability of Azure Data Explorer this could be an option too.

    I have not tested this recently but reading back older messages seems to be reliable.

    You can test it eg. using the Azure Stream Analytics job custom start time:

    User's image

    This should work fine with an Azure IoT Hub input.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.