• 3 min read

Expanding the Microsoft Band through Logic Apps and Power BI

Azure Logic Apps is a powerful new service in Azure for integration and workflows in the cloud. I was able to use Logic Apps to do a real-time integration of my Microsoft Band data with Power BI and Twitter.

Azure Logic Apps is a powerful new service in Azure for integration and workflows in the cloud. What makes Logic Apps great is the ability to take APIs or microservices, which in isolation are limited, and flow together with some logic to create some powerful outcomes. The powerful outcome I wanted to create this weekend was a real-time integration of my Microsoft Band data with Power BI and Twitter. I was able to use Logic Apps to do exactly that, and you can deploy it for yourself too.

Dashboard

As a Microsoft Band wearer, I love the Microsoft Health service, and as a developer I love that they have an API for both the Band and the backend cloud service. The ability to have my Microsoft Health data in Power BI is something I’ve always wanted. As a fan of both services, there’s something about being able to create views, pivots and charts around my health with the muscle of Power BI. While I could do a manual export and upload of my data from time-to-time, I wanted to leverage Azure Logic Apps to integrate the two separate APIs real-time. Not to mention, once the APIs are in Logic Apps, I can leverage any other number of services to integrate the data (e.g. whenever I complete a run, send a tweet with my distance and time).

Building my real-time health Power BI dashboard

Logic Apps allows you to chain together API Apps from the Azure Marketplace (Twitter, BizTalk EDIFACT, Facebook, etc.), and you can also bring your own custom API Apps. To create my Microsoft Health integration, I built two custom API microservices – one for Microsoft Health to get my health and band data, and one for the Power BI REST API to insert this data. You can see the source code for both (and a number of other API App samples) on our Logic Apps GitHub.

Creating a custom API is fairly simple. A few like our JavaScript Script API are barely over 50 lines of code. I built my two API Apps fairly easily, exposed a Swagger document for Logic Apps to understand the API methods, and I was up and running. Once the API Apps were deployed in my Azure Resource Group, I was able to open the Logic Apps Designer and create a few apps. Here’s the three that were most fun for me (if interested, set up for yourself).

  • Logic App is triggered whenever the Microsoft Band has sync’d its data. It then pushes that data to Power BI.
  • Logic App is triggered whenever you have completed an activity with the Band (e.g. a run). It then pushes that data to Power BI.
  • A tweet is sent whenever you have completed an activity with information on it (‘I just ran 1.8 miles in 16 minutes!’).

Power of Azure Logic Apps

Hopefully you can see how Logic Apps allows you to take a set APIs, put some logic behind them, and help them accomplish much more together. As the world moves to a services architectures (and our data along with it), this ability to quickly integrate and act on that data is extremely powerful.In this case I turned a cloud data API into a real-time data publisher for Power BI, and set up notifications on certain events. This same pattern could be followed for any number of APIs and services, including on premise sources like SQL or SAP. You can also use this technique of pushing data into Power BI to push telemetry on your flows to Power BI (see our blog post) – and now you can do this using our Power BI API App sample.

Feel free to include this sample into your own Azure Subscription, integrate your Microsoft Health data with other services, and see how taking control of the APIs you care about most is quick and easy with Azure Logic Apps. If you have any questions, comments, or issues, reach out to us on Twitter @logicappsio.