I am a beginner using grafana, here I’m trying to use grafana and azure monitor to read data and visualize in dashboard. The data I’m getting is from azure IoT hub and a device receiving temperature data in json format e.g ; {“temp”:25}. I configured azure monitor and app registration and successfully integrated with azure monitor but how to read this particular data and display it in dashboard.
configured Grafana and from azure side did role assignment and app registrations. slelected logs and tried the below query.
devices | where deviceId == 'ESPDEVICE01' and measureName == 'temp' | project value
Azure IoT Hub doesn’t act as Telemetry database for querying the data. Indeed it’s storing the data for the specified time defined in the retention policy but you don’t have a direct access to it from the portal. To get the data you can do the following -
Create a Message Route on the Device Telemetry Messages that will route your messages to an external storage
Create an Azure Function with IoT Hub trigger that will get the messages and then you can programmatically route them.
Use tools like Azure IoT Device Explorer
Use the EventProcessorHost library to get the data
Another method is log the data / message data to Application Insights which being send to azure IoT Hub
Send cloud-to-device messages with IoT Hub
Monitor services and apps with Application Insights.