The real power of Stream Analytics is the Stream Analytics Query Language . We will only be doing a simple example, but with this language queries can done as data is received from the input.
To create our query we will select
Job Topology :
We want to create a time-series graph showing response times of queries against time. So, we need to
time . We take those values from the input
inputFromPinoEventHub and send them into the output
dashboard , using
FROM inputFromPinoEventHub and
INTO dashboard .
However, Pino formats time in unix time, and Power BI needs it in ISO 8601 format. In Stream Analytics every event has an associated time stamp. We can override that time stamp and convert our
time value into ISO 8601 format, using
TIMESTAMP BY DATEADD(millisecond, time, 1970-01-01T00:00:00Z) . Lastly we need to change our
SELECT to pick the event time stamp we have overwritten
System.Timestamp AS time .
Lastly, we want to filter for log results that actually have a
responseTime defined, which
WHERE (responseTime > 0) will do for us.
Resulting in this query:
Before we save this as done, we can test the query by uploading test data:
If you run the test, you should get some positive results:
We can now save our query, and then start the Stream Analytics job (this might take a couple of moments). Once, the running sign is up, refresh your Web App url. Then you should see an event:
That single event we witnessed before created a
pino dataset in Power BI. Go ahead and create a couple more data points by refreshing your web page.
DATASETS , click on the
pino , and select a line graph.
To populate our graph, we drag
Axis . And, we drag
To view our graph simply maximise it:
To keep this graph save it to a report.
Pay attention to time zone being displayed. I've noticed 3 time-zones being used in graphs across Azure and Power BI: The time-zone I'm in, the time-zone my company is in, and GMT +0.
We provisioned Event Hubs and Stream Analytics using the Azure Portal point-and-click interface because we wanted a first-time or prototyping user to be up-and-running with Azure as quickly as possible. As your product or usage matures though, you would want to describe your infrastructure in code. This is what Azure Resource Manager templates are for. These templates can be harnessed from the Azure CLI , to deploy, update, or delete your resources in a single action.
Power BI and Azure might not be fully integrated on a UI level yet, but the back end integration works great. Stream Analytics real-time insights combined with Power BIs embedded visualization functionality allows opportunities to present business value metrics to management in custom apps.
Here ends our series on setting up a basic Node.js app using Azure. Next, we will look at using Docker to provision a Node.js app on Azure Web Apps.
: /wp-content/uploads/jekyllsite/blog/2017/07/02b-create-workspace.png Scott Rodgerson