Skip to content

Commit 9638d48

Browse files
authored
Merge pull request #230678 from spelluru/ehubfreshness0314
Event Hubs - Quickstarts - test, update
2 parents 85dd6ef + 3683fa2 commit 9638d48

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

articles/event-hubs/event-hubs-capture-python.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Read Azure Event Hubs captured data from a Python app (latest)
3-
description: This article shows you how to write Python code to capture data that's sent to an event hub and read the captured event data from an Azure storage account.
2+
title: 'Quickstart: Read Azure Event Hubs captured data (Python)'
3+
description: This quickstart shows you how to write Python code to capture data that's sent to an event hub and read the captured event data from an Azure storage account.
44
ms.topic: quickstart
5-
ms.date: 01/04/2021
5+
ms.date: 03/14/2023
66
ms.devlang: python
77
ms.custom: mode-api
88
---
99

10-
# Capture Event Hubs data in Azure Storage and read it by using Python (azure-eventhub)
10+
# Quickstart: Capture Event Hubs data in Azure Storage and read it by using Python (azure-eventhub)
1111

1212
You can configure an event hub so that the data that's sent to an event hub is captured in an Azure storage account or Azure Data Lake Storage Gen 1 or Gen 2. This article shows you how to write Python code to send events to an event hub and read the captured data from **Azure Blob storage**. For more information about this feature, see [Event Hubs Capture feature overview](event-hubs-capture-overview.md).
1313

14-
This quickstart uses the [Azure Python SDK](https://azure.microsoft.com/develop/python/) to demonstrate the Capture feature. The *sender.py* app sends simulated environmental telemetry to event hubs in JSON format. The event hub is configured to use the Capture feature to write this data to Blob storage in batches. The *capturereader.py* app reads these blobs and creates an append file for each device. The app then writes the data into CSV files.
14+
This quickstart uses the [Azure Python SDK](https://azure.microsoft.com/develop/python/) to demonstrate the Capture feature. The **sender.py** app sends simulated environmental telemetry to event hubs in JSON format. The event hub is configured to use the Capture feature to write this data to Blob storage in batches. The **capturereader.py** app reads these blobs and creates an append file for each device. The app then writes the data into CSV files.
1515

1616
In this quickstart, you:
1717

@@ -32,13 +32,16 @@ In this quickstart, you:
3232
- An Azure subscription. If you don't have one, [create a free account](https://azure.microsoft.com/free/) before you begin.
3333
- An active Event Hubs namespace and event hub.
3434
[Create an Event Hubs namespace and an event hub in the namespace](event-hubs-create.md). Record the name of the Event Hubs namespace, the name of the event hub, and the primary access key for the namespace. To get the access key, see [Get an Event Hubs connection string](event-hubs-get-connection-string.md#azure-portal). The default key name is *RootManageSharedAccessKey*. For this quickstart, you need only the primary key. You don't need the connection string.
35-
- An Azure storage account, a blob container in the storage account, and a connection string to the storage account. If you don't have these items, do the following:
35+
- An Azure storage account, a blob container in the storage account, and a connection string to the storage account. If you don't have these items, do the following steps:
3636
1. [Create an Azure storage account](../storage/common/storage-account-create.md?tabs=azure-portal)
3737
1. [Create a blob container in the storage account](../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container)
38-
1. [Get the connection string to the storage account](../storage/common/storage-configure-connection-string.md)
38+
1. [Get the connection string to the storage account](../storage/common/storage-account-get-info.md#get-a-connection-string-for-the-storage-account)
39+
3940

4041
Be sure to record the connection string and container name for later use in this quickstart.
41-
- Enable the Capture feature for the event hub. To do so, follow the instructions in [Enable Event Hubs Capture using the Azure portal](event-hubs-capture-enable-through-portal.md). Select the storage account and the blob container you created in the preceding step. You can also enable the feature when you create an event hub.
42+
43+
## Enable Capture feature for the event hub
44+
Enable the Capture feature for the event hub. To do so, follow the instructions in [Enable Event Hubs Capture using the Azure portal](event-hubs-capture-enable-through-portal.md). Select the storage account and the blob container you created in the preceding step. Select **Avro** for **Output event serialization format**.
4245

4346
## Create a Python script to send events to your event hub
4447
In this section, you create a Python script that sends 200 events (10 devices * 20 events) to an event hub. These events are a sample environmental reading that's sent in JSON format.
@@ -86,7 +89,7 @@ In this section, you create a Python script that sends 200 events (10 devices *
8689
[![Verify that the event hub received the messages](./media/get-started-capture-python-v2/messages-portal.png)](./media/get-started-capture-python-v2/messages-portal.png#lightbox)
8790

8891
## Create a Python script to read your Capture files
89-
In this example, the captured data is stored in Azure Blob storage. The script in this section reads the captured data files from your Azure storage account and generates CSV files for you to easily open and view. You will see 10 files in the current working directory of the application. These files will contain the environmental readings for the 10 devices.
92+
In this example, the captured data is stored in Azure Blob storage. The script in this section reads the captured data files from your Azure storage account and generates CSV files for you to easily open and view. You see 10 files in the current working directory of the application. These files contain the environmental readings for the 10 devices.
9093

9194
1. In your Python editor, create a script called *capturereader.py*. This script reads the captured files and creates a file for each device to write the data only for that device.
9295
2. Paste the following code into *capturereader.py*.
@@ -176,7 +179,7 @@ In this example, the captured data is stored in Azure Blob storage. The script i
176179
python capturereader.py
177180
```
178181

179-
This capture processor uses the local directory to download all the blobs from the storage account and container. It processes any that are not empty, and it writes the results as CSV files into the local directory.
182+
This capture processor uses the local directory to download all the blobs from the storage account and container. It processes files that aren't empty, and it writes the results as CSV files into the local directory.
180183

181184
## Next steps
182185
Check out [Python samples on GitHub](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples).

articles/event-hubs/event-hubs-resource-manager-namespace-event-hub.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
---
2-
title: 'Quickstart: Create an event hub with consumer group - Azure Event Hubs'
2+
title: 'Quickstart: Create an Azure event hub with consumer group'
33
description: 'Quickstart: Create an Event Hubs namespace with an event hub and a consumer group using Azure Resource Manager templates'
44
ms.topic: quickstart
55
ms.custom: subject-armqs, mode-arm
66
ms.date: 06/08/2021
77
---
88

99
# Quickstart: Create an event hub by using an ARM template
10-
11-
Azure Event Hubs is a Big Data streaming platform and event ingestion service, capable of receiving and processing millions of events per second. Event Hubs can process and store events, data, or telemetry produced by distributed software and devices. Data sent to an event hub can be transformed and stored using any real-time analytics provider or batching/storage adapters. For detailed overview of Event Hubs, see [Event Hubs overview](event-hubs-about.md) and [Event Hubs features](event-hubs-features.md). In this quickstart, you create an event hub by using an [Azure Resource Manager template (ARM template)](../azure-resource-manager/management/overview.md). You deploy an ARM template to create a namespace of type [Event Hubs](./event-hubs-about.md), with one event hub.
12-
13-
[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)]
14-
15-
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template will open in the Azure portal.
16-
17-
[![Deploy to Azure](../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.eventhub%2Feventhubs-create-namespace-and-eventhub%2Fazuredeploy.json)
10+
In this quickstart, you create an event hub by using an [Azure Resource Manager template (ARM template)](../azure-resource-manager/management/overview.md). You deploy an ARM template to create a namespace of type [Event Hubs](./event-hubs-about.md), with one event hub.
1811

1912
## Prerequisites
2013

21-
If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
14+
- If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
15+
- If you're new to Azure Event Hubs, see [Event Hubs overview](event-hubs-about.md) and [Event Hubs features](event-hubs-features.md).
16+
2217

2318
## Review the template
2419

@@ -35,9 +30,22 @@ To find more template samples, see [Azure Quickstart Templates](https://azure.mi
3530

3631
## Deploy the template
3732

38-
To deploy the template:
33+
### Using Azure portal user interface
34+
35+
1. If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template opens in the Azure portal.
36+
37+
[![Deploy to Azure](../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.eventhub%2Feventhubs-create-namespace-and-eventhub%2Fazuredeploy.json)
38+
2. Select an existing **resource group** or create a resource group and select it.
39+
1. Select the **region**.
40+
1. Enter a unique **name** for the **project**. This name is used to generate names for an Event Hubs namespace and an event hub in the namespace.
41+
1. Select **Review + create**.
42+
1. On the **Review + create** page, select **Create**.
43+
44+
### Using Azure Cloud Shell
45+
46+
To deploy the template using Azure Cloud Shell:
3947

40-
1. Select **Try it** from the following code block, and then follow the instructions to sign in to the Azure Cloud Shell.
48+
1. Select **Open Cloud Shell** from the following code block, and then follow the instructions to sign in to the Azure Cloud Shell.
4149

4250
```azurepowershell-interactive
4351
$projectName = Read-Host -Prompt "Enter a project name that is used for generating resource names"
@@ -55,6 +63,7 @@ To deploy the template:
5563

5664
1. Select **Copy** to copy the PowerShell script.
5765
1. Right-click the shell console, and then select **Paste**.
66+
1. Press **ENTER** to run the commands.
5867

5968
## Validate the deployment
6069

0 commit comments

Comments
 (0)