Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This tutorial shows how you can use the Stream Analytics no code editor to compute aggregates on real time data streams and store it in Azure Synapse Analytics.
In this tutorial, you learn how to:
Before you start, make sure you've completed the following steps:
If you don't have an Azure subscription, create a free account.
Deploy the TollApp event generator to Azure, use this link to Deploy TollApp Azure Template. Set the 'interval' parameter to 1. And use a new resource group for this step.
Create an Azure Synapse Analytics workspace with a Dedicated SQL pool.
Note
If you'd like to build the real-time Power BI dashboard directly without capturing the data into database, you can skip step#3 and 4, then go to this guide to build real-time dashboard with Power BI dataset produced by Stream Analytics job.
Create a table named carsummary
using your Dedicated SQL pool. You can do it by running the following SQL script:
CREATE TABLE carsummary
(
Make nvarchar(20),
CarCount int,
times datetime
)
WITH ( CLUSTERED COLUMNSTORE INDEX ) ;
Locate the Resource Group in which the TollApp event generator was deployed.
Select the Azure Event Hubs namespace.
On the Event Hubs Namespace page, select Event Hubs under Entities on the left menu.
Select entrystream
instance.
Go to Process data under Features section and then select start on the Start with blank canvas template.
Name your job carsummary
and select Create.
On the event hub configuration page, confirm the following settings, and then select Connect.
Within few seconds, you see sample input data and the schema. You can choose to drop fields, rename fields or change data type if you want.
Select Operations on the command bar and then select Group by.
Select the Group by tile on the canvas and connect it to the event hub tile.
Configure the Group by tile by specifying:
Select Group by, and notice the grouped data in the Data preview tab at the bottom of the page.
On the command bar, select Operations and then Manage fields.
Connect Group by and Manage fields tiles.
On the Manage fields page, follow these steps:
Select Add all fields on the Manage fields configuration page.
Select ... next to the fields, and select Edit to rename them.
Select Done on the Manage fields page. The Manage fields page should look as shown in the following image.
Select Manage fields tile, and see the data flowing into the operation in the Data preview tab at the bottom of the page.
On the command bar, select Outputs, and then select Synapse.
Connect the Synapse tile to the Manage fields tile on your canvas.
On the Synapse settings page, follow these steps:
If the Job storage account isn't already set, select the Azure Data Lake Storage account in the resource group. It's the storage account that is used by Synapse SQL to load data into your data warehouse.
Select the Azure subscription where your Azure Synapse Analytics is located.
Select the database of the Dedicated SQL pool that you used to create the carsummary
table in the previous section.
Enter username and password to authenticate.
Enter table name as carsummary
.
Select Connect. You see sample results that will be written to your Synapse SQL table.
Select Synapse tile and see the Data preview tab at the bottom of the page. You see the data flowing into the dedicated SQL pool.
Select Save in the top ribbon to save your job and then select Start.
On the Start Stream Analytics Job page, select Start to run your job.
You then see a list of all Stream Analytics jobs created using the no code editor. And within two minutes, your job goes to a Running state. Select the Refresh button on the page to see the status changing from Created -> Starting -> Running.
Download the latest version of Power BI desktop.
Use the Power BI connector for Azure Synapse SQL.
Connect to your database with DirectQuery, and use this query to fetch data from your database
SELECT [Make],[CarCount],[times]
FROM [dbo].[carsummary]
WHERE times >= DATEADD(day, -1, GETDATE())
Switch to Database tab, and enter your credentials (user name and password) to connect to the database and run the query.
Select Load to load data into the Power BI.
You can then create a line chart with
Except the Azure Synapse SQL, you can also use the SQL Database as the no-code editor output to receive the streaming data. And then use Power BI connector to connect the SQL Database with your database with DirectQuery as well to build the real-time dashboard.
It's also a good option to build the real-time dashboard with your streaming data. For more information about the SQL Database output, see Transform and ingest to SQL Database.
In this tutorial, you created a Stream Analytics job using the no code editor to define aggregations and write results to Azure Synapse Analytics. You then used the Power BI to build a real-time dashboard to see the results produced by the job.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayTraining
Module
Visualize real-time data with Azure Stream Analytics and Power BI - Training
By combining the stream processing capabilities of Azure Stream Analytics and the data visualization capabilities of Microsoft Power BI, you can create real-time data dashboards.
Certification
Microsoft Certified: Power BI Data Analyst Associate - Certifications
Demonstrate methods and best practices that align with business and technical requirements for modeling, visualizing, and analyzing data with Microsoft Power BI.