Skip to content

Commit 0a6791d

Browse files
authored
Merge pull request #238862 from spelluru/ehubasa0522
review, test, and update Enable real-time insights from event data
2 parents ce60631 + 22f6c3b commit 0a6791d

File tree

9 files changed

+45
-29
lines changed

9 files changed

+45
-29
lines changed
22.9 KB
Loading
24.2 KB
Loading
-97.1 KB
Loading
-23.4 KB
Loading
-65.4 KB
Loading
-72.2 KB
Loading
40.2 KB
Loading
-94.5 KB
Loading
Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
title: Process data from Event Hubs Azure using Stream Analytics | Microsoft Docs
33
description: This article shows you how to process data from your Azure event hub using an Azure Stream Analytics job.
4-
ms.date: 03/14/2022
5-
ms.topic: article
4+
ms.date: 05/22/2023
5+
ms.topic: how-to
66
---
77

88

99
# Process data from your event hub using Azure Stream Analytics
10-
The Azure Stream Analytics service makes it easy to ingest, process, and analyze streaming data from Azure Event Hubs, enabling powerful insights to drive real-time actions. This integration allows you to quickly create a hot-path analytics pipeline. You can use the Azure portal to visualize incoming data and write a Stream Analytics query. Once your query is ready, you can move it into production in only a few clicks.
10+
The Azure Stream Analytics service makes it easy to ingest, process, and analyze streaming data from Azure Event Hubs, enabling powerful insights to drive real-time actions. You can use the Azure portal to visualize incoming data and write a Stream Analytics query. Once your query is ready, you can move it into production in only a few clicks.
1111

1212
## Key benefits
1313
Here are the key benefits of Azure Event Hubs and Azure Stream Analytics integration:
14+
1415
- **Preview data** – You can preview incoming data from an event hub in the Azure portal.
1516
- **Test your query** – Prepare a transformation query and test it directly in the Azure portal. For the query language syntax, see [Stream Analytics Query Language](/stream-analytics-query/built-in-functions-azure-stream-analytics) documentation.
1617
- **Deploy your query to production** – You can deploy the query into production by creating and starting an Azure Stream Analytics job.
@@ -22,70 +23,85 @@ Here are the key benefits of Azure Event Hubs and Azure Stream Analytics integra
2223
2324
1. Sign in to the [Azure portal](https://portal.azure.com).
2425
1. Navigate to your **Event Hubs namespace** and then navigate to the **event hub**, which has the incoming data.
25-
1. Select **Process Data** on the event hub page.
26+
1. Select **Process Data** on the event hub page or select **Process data** on the left menu.
2627

27-
![Process data tile](./media/process-data-azure-stream-analytics/process-data-tile.png)
28-
1. Select **Explore** on the **Enable real-time insights from events** tile.
28+
:::image type="content" source="./media/process-data-azure-stream-analytics/process-data-tile.png" alt-text="Screenshot showing the Process data page for the event hub." lightbox="./media/process-data-azure-stream-analytics/process-data-tile.png":::
29+
1. Select **Start** on the **Enable real-time insights from events** tile.
2930

30-
![Select Stream Analytics](./media/process-data-azure-stream-analytics/process-data-page-explore-stream-analytics.png)
31+
:::image type="content" source="./media/process-data-azure-stream-analytics/process-data-page-explore-stream-analytics.png" alt-text="Screenshot showing the Process data page with Enable real time insights from events tile selected." lightbox="./media/process-data-azure-stream-analytics/process-data-page-explore-stream-analytics.png":::
3132
1. You see a query page with values already set for the following fields:
3233
1. Your **event hub** as an input for the query.
3334
1. Sample **SQL query** with SELECT statement.
3435
1. An **output** alias to refer to your query test results.
3536

36-
![Query editor](./media/process-data-azure-stream-analytics/query-editor.png)
37+
:::image type="content" source="./media/process-data-azure-stream-analytics/query-editor.png" alt-text="Screenshot showing the Query editor for your Stream Analytics query." lightbox="./media/process-data-azure-stream-analytics/query-editor.png":::
3738

3839
> [!NOTE]
3940
> When you use this feature for the first time, this page asks for your permission to create a consumer group and a policy for your event hub to preview incoming data.
4041
1. Select **Create** in the **Input preview** pane as shown in the preceding image.
41-
1. You'll immediately see a snapshot of the latest incoming data in this tab.
42+
1. You immediately see a snapshot of the latest incoming data in this tab.
4243
- The serialization type in your data is automatically detected (JSON/CSV). You can manually change it as well to JSON/CSV/AVRO.
4344
- You can preview incoming data in the table format or raw format.
4445
- If your data shown isn't current, select **Refresh** to see the latest events.
4546

46-
Here is an example of data in the **table format**:
47-
![Results in the table format](./media/process-data-azure-stream-analytics/snapshot-results.png)
47+
Here's an example of data in the **table format**:
4848

49-
Here is an example of data in the **raw format**:
49+
:::image type="content" source="./media/process-data-azure-stream-analytics/snapshot-results.png" alt-text="Screenshot of the Input preview window in the result pane of the Process data page in a table format." lightbox="./media/process-data-azure-stream-analytics/snapshot-results.png":::
5050

51-
![Results in the raw format](./media/process-data-azure-stream-analytics/snapshot-results-raw-format.png)
51+
Here's an example of data in the **raw format**:
52+
53+
:::image type="content" source="./media/process-data-azure-stream-analytics/snapshot-results-raw-format.png" alt-text="Screenshot of the Input preview window in the result pane of the Process data page in the raw format." lightbox="./media/process-data-azure-stream-analytics/snapshot-results-raw-format.png":::
5254
1. Select **Test query** to see the snapshot of test results of your query in the **Test results** tab. You can also download the results.
5355

54-
![Test query results](./media/process-data-azure-stream-analytics/test-results.png)
56+
:::image type="content" source="./media/process-data-azure-stream-analytics/test-results.png" alt-text="Screenshot of the Input preview window in the result pane with test results." lightbox="./media/process-data-azure-stream-analytics/test-results.png":::
5557
1. Write your own query to transform the data. See [Stream Analytics Query Language reference](/stream-analytics-query/stream-analytics-query-language-reference).
56-
1. Once you've tested the query and you want to move it in to production, select **Deploy query**. To deploy the query, create an Azure Stream Analytics job where you can set an output for your job, and start the job. To create a Stream Analytics job, specify a name for the job, and select **Create**.
57-
58-
![Create an Azure Stream Analytics job](./media/process-data-azure-stream-analytics/create-stream-analytics-job.png)
59-
60-
> [!NOTE]
61-
> We recommend that you create a consumer group and a policy for each new Azure Stream Analytics job that you create from the Event Hubs page. Consumer groups allow only five concurrent readers, so providing a dedicated consumer group for each job will avoid any errors that might arise from exceeding that limit. A dedicated policy allows you to rotate your key or revoke permissions without impacting other resources.
58+
1. Once you've tested the query and you want to move it in to production, select **Create Stream Analytics job**.
59+
60+
:::image type="content" source="./media/process-data-azure-stream-analytics/create-job-link.png" alt-text="Screenshot of the Query page with the Create Stream Analytics job link selected.":::
61+
1. On the **New Stream Analytics job** page, follow these steps:
62+
1. Specify a **name** for the job.
63+
1. Select your **Azure subscription** where you want the job to be created.
64+
1. Select the **resource group** for the Stream Analytics job resource.
65+
1. Select the **location** for the job.
66+
1. For the **Event Hubs policy name**, create a new policy or select an existing one.
67+
1. For the **Event Hubs consumer group**, create a new consumer group or select an existing consumer group.
68+
1. Select **Create** to create the Stream Analytics job.
69+
70+
:::image type="content" source="./media/process-data-azure-stream-analytics/create-stream-analytics-job.png" alt-text="Screenshot showing the New Stream Analytics job window.":::
71+
72+
> [!NOTE]
73+
> We recommend that you create a consumer group and a policy for each new Azure Stream Analytics job that you create from the Event Hubs page. Consumer groups allow only five concurrent readers, so providing a dedicated consumer group for each job will avoid any errors that might arise from exceeding that limit. A dedicated policy allows you to rotate your key or revoke permissions without impacting other resources.
6274
1. Your Stream Analytics job is now created where your query is the same that you tested, and input is your event hub.
6375

64-
9. To complete the pipeline, set the **output** of the query, and select **Start** to start the job.
76+
:::image type="content" source="./media/process-data-azure-stream-analytics/add-output-link.png" alt-text="Screenshot showing the Stream Analytics job page with a link to add an output.":::
77+
9. Add an [output](../stream-analytics/stream-analytics-define-outputs.md) of your choice.
78+
1. Navigate back to Stream Analytics job page by clicking the name of the job in breadcrumb link.
79+
1. Select **Edit query** above the **Query** window.
80+
1. Update `[OutputAlias]` with your output name, and select **Save query** link above the query. Close the Query page by selecting X in the top-right corner.
81+
1. Now, on the Stream Analytics job page, select **Start** on the toolbar to start the job.
6582

66-
> [!NOTE]
67-
> Before starting the job, don't forget to replace the outputalias by the output name you created in Azure Stream Analytics.
68-
69-
![Set output and start the job](./media/process-data-azure-stream-analytics/set-output-start-job.png)
83+
:::image type="content" source="./media/process-data-azure-stream-analytics/set-output-start-job.png" alt-text="Screenshot of the Start job window for a Stream Analytics job.":::
7084

7185

7286
## Access
73-
Issue : User cannot access Preview data because they don’t have right permissions on the Subscription.
87+
**Issue** : User can't access preview data because they don’t have right permissions on the Subscription.
7488

7589
Option 1: The user who wants to preview incoming data needs to be added as a Contributor on Subscription.
7690

7791
Option 2: The user needs to be added as Stream Analytics Query tester role on Subscription. Navigate to Access control for the subscription. Add a new role assignment for the user as "Stream Analytics Query Tester" role.
7892

79-
Option 3: The user can create Azure Stream Analytics job. Set input as this Event Hub and navigate to "Query" to preview incoming data from this Event Hub.
93+
Option 3: The user can create Azure Stream Analytics job. Set input as this event hub and navigate to "Query" to preview incoming data from this event hub.
8094

8195
Option 4: The admin can create a custom role on the subscription. Add the following permissions to the custom role and then add user to the new custom role.
82-
![Add permissions to custom role](./media/process-data-azure-stream-analytics/custom-role.png)
96+
97+
:::image type="content" source="./media/process-data-azure-stream-analytics/custom-role.png" alt-text="Screenshots showing Microsoft.StreamAnalytics permissions page." lightbox="./media/process-data-azure-stream-analytics/custom-role.png":::
8398

8499

85100
## Streaming units
86101
Your Azure Stream Analytics job defaults to three streaming units (SUs). To adjust this setting, select **Scale** on the left menu in the **Stream Analytics job** page in the Azure portal. To learn more about streaming units, see [Understand and adjust Streaming Units](../stream-analytics/stream-analytics-streaming-unit-consumption.md).
87102

88-
![Scale streaming units](./media/process-data-azure-stream-analytics/scale.png)
103+
104+
:::image type="content" source="./media/process-data-azure-stream-analytics/scale.png" alt-text="Screenshots showing the Scale page for a Stream Analytics job." lightbox="./media/process-data-azure-stream-analytics/scale.png":::
89105

90106
## Next steps
91107
To learn more about Stream Analytics queries, see [Stream Analytics Query Language](/stream-analytics-query/built-in-functions-azure-stream-analytics)

0 commit comments

Comments
 (0)