In the previous post I showed how to develop a simple AndroidThings project and deploy it to a Raspberry Pi device. The project sends temperature and humidity sensor reading up to the Azure cloud.

In this post I will show how to consume sensor data in the cloud and publish it to a Power BI dashboard for real-time visual representation. I will start by going back to our Connect The Dots example IoT project. I will add another Azure Streaming Analytics resource to our Connect The Dots resource group. An Azure Streaming Analytics (ASA) job allows for near real-time analysis on “hot” streaming data from a variety of IoT devices. In our case we will be taking input data from our IoTHubStream  (originating from our Connect the Dots IoT hub) and splitting off sensor data and feeding it to the Power BI service as an output (Power BI service being the destination endpoint). Provisioning input and output streams is actually quite easy as Azure is already aware of the existing IoT hub from the resource group and many of the services and selections are just point and click. Here we just show one input, the IoTHubStream and one output, the Power BI service. Of course we could add more …like adding a database as an output sink but lets keep it simple for now.

ASA allows for a “SQL like” query language to condition the data streams. I will use a simple script to direct the sensor data to the output sink.

ASA has additional features that allow you to exercise your query with “test” data. You can actually upload a test json data file or capture a segment of data from the live stream.

If all is set you can start the service and client and hopefully you will see the input and output monitoring graph update as shown above.

The final step is to import the streaming data into a Power BI dashboard. When we set the output in ASA we associated it with our Power BI online account so after logging in and opening the Power BI web service we should see our dataset prepopulated:

From here we can create a new streaming dashboard and populate it with “tiles” that dynamically update.

Fantastic! A streaming dashboard that shows, in real-time, temperature and humidity as originating from an AndroidThings device!