S Andrew
S Andrew

Reputation: 7218

How to get older data uploaded by devices to Azure IoT hub

I have a few Raspberry Pi devices uploading data to Azure IoT Hub. I can see all the data on Device Explorer. But is there any way I can see the data of specific time frame? Let's say complete data of last 1 hour?

Upvotes: 1

Views: 235

Answers (1)

Matthijs van der Veer
Matthijs van der Veer

Reputation: 4085

You can achieve this with Service Bus Explorer. The name might suggest it's only for Service Bus, but it has Event Hub and IoT Hub support as well. To see the data for the last hour, do the following:

Copy the Event Hub compatible endpoint from the Azure Portal and strip off the EntityPath. Example: Endpoint=sb://REDACTED.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=REDACTED=;EntityPath=hub-name

becomes: Endpoint=sb://REDACTED.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=REDACTED=

Open Service Bus Explorer and create a new IoT Hub Listener.

Service Bus Explorer

Add the connection string without the entity path and add the entity path as the Endpoint.

Enter Credentials

This will open a new listener window. In the window, you can select a start time. Select a time one hour back. The minimum retention period is a day, but if you decide to choose a time further in the past, that time should be within the retention period of the endpoint. If you select a time before the retention period, you will see events from the beginning of the retention period.

Set Start Time

If you want to inspect the events, you can go to the Events tab and have a look at the data.

Upvotes: 2

Related Questions