Hello @ SilverChips, Thanks for reaching out to us!.
Events are aged off Event Hub. So the retention policy will take care of this.
By default, messages are routed to the built-in service-facing endpoint (messages/events) that is compatible with Event Hubs. The number of partitions and retention period are key properties of an event hub.
An IoT hub exposes the following properties to enable you to control the built-in Event Hub-compatible messaging endpoint messages/events.
- IoT Hub allows data retention in the built-in Event Hubs for a maximum of 7 days. You can set the retention time during creation of your IoT Hub.
- Data retention time in IoT Hub depends on your IoT hub tier and unit type.
- If your devices are sending smaller messages, they may be retained for longer (up to 7 days) depending on how much storage is consumed.
- Messages will expire and will not be accessible after the retention time has passed.
- You can modify the retention time, either programmatically using the IoT Hub resource provider REST APIs, or with the Azure portal.
How to edit retention days [between 1 & 7 days] from Azure portal, sample image:
Please let us know if you need further help in this matter. For more information please read this document.