Reporting on Application Insights REST APIs with Power BI
· Developers can access their Application Insights data (events, metrics & analytics queries) using REST APIs from https://dev.applicationinsights.io/
To Demo this:
· Open https://dev.applicationinsights.io/ to demo REST APIs using the fabrikamprod resource.
REST APIs are one of the ways to access your Application Insights Data (in addition to Azure Portal, Analytics Portal, OMS Portal, Visual Studio, VSTS, Continuous Export, PowerBI, etc.)
· Browse to the “API Explorer” section of the website and enter the following details to access data from fabrikamprod resource. API Explorer lets you play with the APIs and evaluate the results, enabling you to identify the optimal HTTP/cURL Requests for your purposes.
· You can see the HTTP Request on the Top-Right and the actual response on the Bottom-Right. Click on Visualize to see the data in graphical format:
· To demo Query API, select “GET /query” on the left window.
In the Query box, type any Analytics query (e.g. requests | where timestamp >= ago(7d) | where client_CountryOrRegion == “Germany” | project name, duration, client_CountryOrRegion | where name has “GET”)
Click Fetch! and see the HTTP Request & the Response on the Right side:
To get data into Power BI
1. Open Power BI > select Get Data
2. Select Web and select Advanced
In this dialog paste the URL from the CURL dialog and add the x-api-key as a separate request header.
See the following two screen shots below.
The URL I am using is:
3. Format the JSON into tables for Power BI
In the Query Editor select the values right click and choose “Into Table”
4. Expand the JSON into constituent columns
Expand Segments into Rows
Further Expand Segments into child columns
Further Expand the Count.Sum column from Segments.requests parent JSON.
At this point you can start looking at your applications run time data from Power BI collected by Application Insights!
As I am not seeing those big shark fins/oscillations to it looks like the DOS or campaign is over and everything looks like it is running fine!