Quantcast
Channel: Cloud Training Program
Viewing all articles
Browse latest Browse all 1891

Case Study: Display Live Data Streaming Using Power BI Service

$
0
0

This blog post gives a walkthrough of the Step-By-Step hands-on Case-Study on Displaying Live Streaming Data using Power BI Service which we will be discussing in detail in our Microsoft Data Analyst Associate [DA-100] FREE CLASS. To understand more about the certification read our blog Microsoft Certified Power BI Data Analyst Associate.

In our Displaying Live Streaming Data using Power BI Service case study, we’ll be reading data from an application that generates live stream data, and then we are going to ingest it by using Event hub, process the data in real-time using Stream Analytics, then we’ll use Power BI to visualize this live streaming data.

The following diagram shows the logical components of the case study, such as Data generator, Azure Event Hubs, Stream Analytics, and Power BI.

Case-study-diagram-img

Before performing the copy activity, we should understand the basics concept such as Azure Event Hubs, Stream Analytics, and Power BI.

Overview Of Azure Event Hubs

  • It is a big data streaming platform and event ingestion service.
  • It can process and receive millions of events per second.
  • Data sent to an event hub can be stored and transformed by using any real-time analytics provider or storage/batching adapters.
  • The scenarios where you can use Event Hubs:
    • Live dashboarding
    • Analytics pipelines, such as clickstreams
    • Anomaly detection (fraud/outliers)
    • Application logging
    • User telemetry processing
    • Device telemetry streaming

event-hub-image

Note: If you want to learn more about it, check our Azure Event Hubs blog.

Overview Of Azure Stream Analytics

  • Azure Stream Analytics service is recommended for stream analytics on Azure.
  • It provides you with the ability to ingest, process, and analyze streaming data from Azure Event Hubs and Azure IoT Hub.
  • Azure Stream Analytics is meant for a wide range of cases that include:
    • Extract, Transform, Load (ETL)
    • Real-time alerts from temporal and spatial patterns or anomalies
    • IoT Edge
    • Event Sourcing pattern

stream-analytics-img

Note: If you want to learn more about it, check our Azure Stream Analytics blog.

Overview Of Power BI

  • Microsoft Power BI is a package of software services, apps, and connectors that sync to turn your unrelated sources of data into coherent, visually immersive, and interactive insights.
  • Whether your data is a collection of cloud-based and on-premises hybrid data warehouses or a simple Microsoft Excel workbook, Power BI lets you easily connect to your data sources, clean, and model your data without affecting the underlying source, visualize what’s significant, and share that with anyone or everyone you want.

pbi-intro-img

Note: If you want to learn more about it, check our Power BI blog.

Requirements For Displaying Live Streaming Data Using Power BI Service Are:

  1. Machine Temperature Application.
  2. Visual Studio Community Edition to run the application.
  3. Azure Subscription.

Steps: –

1. Open Machine Temperature Application on visual studio. where we are going to generate the virtual machines, by using them, we’ll be able to generate machines temperature data.

Machine-Temperature-Application-img

2. Click on start.

start-application-img

3. Go to the Azure portal, and select Create a resource at the top left of the screen.

create-resource-img

4. On the create resource page, search for Event Hub. Click on Event Hubs.

search-eventhub-img

5. Create Event Hubs.

create-event-hub-img

6. On the Create namespace page, fill in the basic details. Click on Review + Create.

basic-details-img

7. On the Review + Create page, select Create. Wait for the deployment to complete.

Create-img

8. On the Deployment page, select Go To Resource.

Go-to-resource-img

9. At the top of the window, select + Event Hub.

add-event-hub-img

10. Type a name for your event hub, then select Create.

create-event-hub

11. Click on the Event hub name to grant access to the event hub, in the blade under the section settings on the left click Shared access policies. Click on Add. Enter policy name, select manage, and then click on create.

add-Shared-access-policies

 

12. Click on your new policy after it has been created, and then select the copy button for the CONNECTION STRING – PRIMARY KEY.

CONNECTION-STRING

13. Copy this connection string in vs-code in the value column and then save it. Once it is saved then start the application.

connection-string-in-vs-code-img

14. Go back to the Azure portal, navigate and click on the + Create a resource icon, type STREAM, and then click the Stream Analytics Job, and then click Create.

Stream-Analytics-Job

15. In the New Stream Analytics job screen, fill out the following details and then click on Create:

  • Job name
  • Subscription
  • Resource group
  • Location

Create-Stream-Analytics-job

16. Once the stream analytics job is deployed click on Go to Resource.

deployed-Stream-Analytics-job-img

17. In the Inputs screen, click + Add stream input, and then click Event Hubs.

Add-stream-input-img

18. Event Hub screen, type in the following values and click the Save button.

  • Input alias
  • Select Event Hub from your subscriptions
  • Subscription
  • Event Hub Namespace
  • Event Hub Name
  • Event Hub Consumer Group
  • Authentication Method
  • Event Hub Policy Name

Event-Hub-screen-img

19. In the Outputs screen, click + Add, and then click Power BI.

Stream-Analytics-job-output-img

20. Give credentials of Powerbi.com account by clicking on Authorize and give workspace name, Authentication mode, dataset, and table name for RealTIME data. Click on Save.

Power-bi-input-img

21. In your stream analytics job window, in the Query screen in the middle of the window, click on Edit query, Save the below code.

SELECT max(temperatureReadTimestamp) as WindowEnd,
    avg(temperature) as averageTemperature,
    stdevp(temperature) as stdeviationTemperature,
    max(temperature) as maxTemperature,
    min(temperature) as minTemperature,
    machineName
Into PowerBIOutput
FROM
    InputStream TIMESTAMP BY temperatureReadTimestamp
    GROUP BY TUMBLINGWINDOW(s, 1), machineName

save-sql-query-img

21. Start stream analytics job.

start-job-img

22. Open PowerBI.com and sign in with your account. Go to My Workspace and select Datasets. You can see a Real-time Data Stream dataset is created. Click on new to create a new dashboard.

powerbi-workspace-img

23. Add a new tile of type custom stream tile. Select Next.

source-stream-analytics-img

25. Select your dataset then click on next.

select-dataset-img

26. Create a live report by selecting the line chart and values for axis, legend, values, and tumbling window of 10 sec and click on NEXT.

visualization-desgin-img

27. Give the name to the report as “DemoStreaming”. Select Apply.
report-name-img

28. Now you can change values for temperature via an application and see the live changes occur on power BI reports.

temperature-change-img

29. Congratulations! You have successfully Displaying Live Streaming Data Using Power BI Service.

live-data-in-powerbi-img

References

Next Steps to begin with PL-300 Certification:

In our PL-300 Certification Training Program, we’ll cover 10+ Hands-On Labs. If you wish to start your journey towards becoming a Microsoft Certified: Power BI Data Analyst Associate, try our FREE CLASS.

DA100_CU

The post Case Study: Display Live Data Streaming Using Power BI Service appeared first on Cloud Training Program.


Viewing all articles
Browse latest Browse all 1891

Trending Articles