Skip to content

Commit 4fbb03e

Browse files
Merge pull request #197006 from spelluru/ehubsfuncsynapse0429
Update with latest steps
2 parents 74a39ab + 65ab5ef commit 4fbb03e

File tree

6 files changed

+42
-58
lines changed

6 files changed

+42
-58
lines changed

articles/event-grid/includes/event-grid-event-hubs-functions-synapse-analytics.md

Lines changed: 41 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: event-grid
55
author: spelluru
66
ms.service: event-grid
77
ms.topic: include
8-
ms.date: 12/07/2020
8+
ms.date: 04/29/2022
99
ms.author: spelluru
1010
ms.custom: "include file"
1111

@@ -16,8 +16,8 @@ ms.custom: "include file"
1616
This diagram depicts the workflow of the solution you build in this tutorial:
1717

1818
1. Data sent to an Azure event hub is captured in an Azure blob storage.
19-
2. When the data capture is complete, an event is generated and sent to an Azure event grid.
20-
3. The event grid forwards this event data to an Azure function app.
19+
2. When the data capture is complete, an event is generated and sent to Azure Event Grid.
20+
3. Azure Event Grid forwards this event data to an Azure function app.
2121
4. The function app uses the blob URL in the event data to retrieve the blob from the storage.
2222
5. The function app migrates the blob data to an Azure Synapse Analytics.
2323

@@ -34,10 +34,10 @@ In this article, you take the following steps:
3434
To complete this tutorial, you must have:
3535

3636
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
37-
- [Visual studio 2019](https://www.visualstudio.com/vs/) with workloads for: .NET desktop development, Azure development, ASP.NET and web development, Node.js development, and Python development.
37+
- [Visual studio](https://www.visualstudio.com/vs/) with workloads for: .NET desktop development, Azure development, ASP.NET and web development, Node.js development, and Python development.
3838
- Download the [EventHubsCaptureEventGridDemo sample project](https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo) to your computer.
3939
- WindTurbineDataGenerator – A simple publisher that sends sample wind turbine data to a capture-enabled event hub
40-
- FunctionDWDumper – An Azure Function that receives an Event Grid notification when an Avro file is captured to the Azure Storage blob. It receives the blob’s URI path, reads its contents, and pushes this data to Azure Synapse Analytics (dedicated SQL pool).
40+
- FunctionDWDumper – An Azure Function that receives a notification from Azure Event Grid when an Avro file is captured to the Azure Storage blob. It receives the blob’s URI path, reads its contents, and pushes this data to Azure Synapse Analytics (dedicated SQL pool).
4141

4242
## Deploy the infrastructure
4343
In this step, you deploy the required infrastructure with a [Resource Manager template](https://github.com/Azure/azure-docs-json-samples/blob/master/event-grid/EventHubsDataMigration.json). When you deploy the template, the following resources are created:
@@ -54,17 +54,20 @@ In this step, you deploy the required infrastructure with a [Resource Manager te
5454
1. Sign in to the [Azure portal](https://portal.azure.com).
5555
2. Select **Cloud Shell** button at the top.
5656

57-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/azure-portal.png" alt-text="Azure portal":::
57+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/azure-portal.png" alt-text="Screenshot of Azure portal showing the selection of Cloud Shell button.":::
5858
3. You see the Cloud Shell opened at the bottom of the browser.
59+
1. If you're using the Cloud Shell for the first time:
60+
1. If you see an option to select between **Bash** and **PowerShell**, select **Bash**.
61+
62+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/launch-cloud-shell.png" alt-text="Screenshot of Cloud Shell with Bash selected.":::
5963

60-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/launch-cloud-shell.png" alt-text="Cloud Shell":::
61-
4. In the Cloud Shell, if you see an option to select between **Bash** and **PowerShell**, select **Bash**.
62-
5. If you are using the Cloud Shell for the first time, create a storage account by selecting **Create storage**. Azure Cloud Shell requires an Azure storage account to store some files.
64+
1. Create a storage account by selecting **Create storage**. Azure Cloud Shell requires an Azure storage account to store some files.
6365

64-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/create-storage-cloud-shell.png" alt-text="Create storage for Cloud Shell":::
65-
6. Wait until the Cloud Shell is initialized.
66+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/create-storage-cloud-shell.png" alt-text="Screenshot showing the creation of storage for Cloud Shell.":::
67+
3. Wait until the Cloud Shell is initialized.
6668

67-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/cloud-shell-initialized.png" alt-text="Cloud Shell initialized":::
69+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/cloud-shell-initialized.png" alt-text="Screenshot showing the Cloud Shell initialized.":::
70+
4. In the Cloud Shell, select **Bash** as shown in the above image, if it isn't already selected.
6871
1. Create an Azure resource group by running the following CLI command:
6972
1. Copy and paste the following command into the Cloud Shell window. Change the resource group name and location if you want.
7073

@@ -73,7 +76,7 @@ In this step, you deploy the required infrastructure with a [Resource Manager te
7376
```
7477
2. Press **ENTER**.
7578
76-
Here is an example:
79+
Here's an example:
7780
7881
```azurecli
7982
user@Azure:~$ az group create -l eastus -n rgDataMigration
@@ -109,7 +112,7 @@ In this step, you deploy the required infrastructure with a [Resource Manager te
109112
--template-uri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/EventHubsDataMigration.json \
110113
--parameters eventHubNamespaceName=<event-hub-namespace> eventHubName=hubdatamigration sqlServerName=<sql-server-name> sqlServerUserName=<user-name> sqlServerPassword=<password> sqlServerDatabaseName=<database-name> storageName=<unique-storage-name> functionAppName=<app-name>
111114
```
112-
3. Press **ENTER** in the Cloud Shell window to run the command. This process may take a while since you are creating a bunch of resources. In the result of the command, ensure that there have been no failures.
115+
3. Press **ENTER** in the Cloud Shell window to run the command. This process may take a while since you're creating a bunch of resources. In the result of the command, ensure that there have been no failures.
113116
1. Close the Cloud Shell by selecting the **Cloud Shell** button in the portal (or) **X** button in the top-right corner of the Cloud Shell window.
114117
115118
### Verify that the resources are created
@@ -118,18 +121,18 @@ In this step, you deploy the required infrastructure with a [Resource Manager te
118121
2. Filter the list of resource groups by entering the name of your resource group in the search box.
119122
3. Select your resource group in the list.
120123
121-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/select-resource-group.png" alt-text="Select your resource group":::
124+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/select-resource-group.png" alt-text="Screenshot showing the selection of your resource group.":::
122125
4. Confirm that you see the following resources in the resource group:
123126
124-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/resources-in-resource-group.png" alt-text="Resources in the resource group" lightbox="media/event-grid-event-hubs-functions-synapse-analytics/resources-in-resource-group.png":::
127+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/resources-in-resource-group.png" alt-text="Screenshot showing resources in the resource group." lightbox="media/event-grid-event-hubs-functions-synapse-analytics/resources-in-resource-group.png":::
125128
126129
### Create a table in Azure Synapse Analytics
127-
Create a table in your data warehouse by running the [CreateDataWarehouseTable.sql](https://github.com/Azure/azure-event-hubs/blob/master/samples/e2e/EventHubsCaptureEventGridDemo/scripts/CreateDataWarehouseTable.sql) script. To run the script, you can use Visual Studio or the Query Editor in the portal. The following steps show you how to use the Query Editor:
130+
In this section, you create a table in the dedicated SQL pool you created earlier.
128131
129132
1. In the list of resources in the resource group, select your **dedicated SQL pool**.
130133
2. On the **Dedicated SQL pool** page, in the **Common Tasks** section on the left menu, select **Query editor (preview)**.
131134
132-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/sql-data-warehouse-page.png" alt-text="Azure Synapse Analytics page":::
135+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/sql-data-warehouse-page.png" alt-text="Screenshot showing the selection of Query Editor on a Dedicated SQL pool page in the Azure portal.":::
133136
2. Enter the name of **user** and **password** for the SQL server, and select **OK**. If you see a message about allowing your client to access the SQL server, follow these steps:
134137
1. Select the link: **Set server firewall**.
135138
2. On the **Firewall settings** page, select **Add client IP** on the toolbar, and then select **Save** on the toolbar.
@@ -149,55 +152,36 @@ Create a table in your data warehouse by running the [CreateDataWarehouseTable.s
149152
WITH (CLUSTERED COLUMNSTORE INDEX, DISTRIBUTION = ROUND_ROBIN);
150153
```
151154
152-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/run-sql-query.png" alt-text="Run SQL query":::
155+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/run-sql-query.png" alt-text="Screenshot showing the query editor.":::
153156
5. Keep this tab or window open so that you can verify that the data is created at the end of the tutorial.
154157
155-
### Update the function runtime version
158+
## Publish the Azure Functions app
159+
First, get the publish profile for the Functions app from the Azure portal. Then, use the publish profile to publish the Azure Functions project or app from Visual Studio.
156160
157-
1. Open another tab in the web browser, and navigate to [Azure portal](https://portal.azure.com).
158-
1. In the Azure portal, select **Resource groups** on the left menu.
159-
1. Select the resource group in which the function app exists.
160-
1. Select the **function app** in the list of resources in the resource group.
161-
1. Select **Configuration** under **Settings** on the left menu.
162-
1. Switch to the **Function runtime settings** tab in the right pane.
163-
1. Update the **runtime version** to **~3**.
161+
### Get the publish profile
164162
165-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/function-runtime-version.png" alt-text="Update function runtime version":::
166-
6. Select **Save** on the toolbar.
167-
1. On the **Save changes** confirmation popup, select **Continue**.
163+
1. On the **Resource Group** page, select the **Azure Functions app** in the list of resources.
168164
169-
## Publish the Azure Functions app
165+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/select-function-app.png" alt-text="Screenshot showing the selection of the function app in the list of resources for a resource group.":::
166+
1. On the **Function App** page for your app, select **Get publish profile** on the command bar.
167+
168+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/get-publish-profile.png" alt-text="Screenshot showing the selection of the **Get Publish Profile** button on the command bar of the function app page.":::
169+
1. Download and save the file into the **FunctionEGDDumper** subfolder of the **EventHubsCaptureEventGridDemo** folder.
170+
171+
### Use the publish profile to publish the Functions app
170172
171173
1. Launch Visual Studio.
172174
2. Open the **EventHubsCaptureEventGridDemo.sln** solution that you downloaded from the [GitHub](https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo) as part of the prerequisites. You can find it in the `/samples/e2e/EventHubsCaptureEventGridDemo` folder.
173175
3. In Solution Explorer, right-click **FunctionEGDWDumper** project, and select **Publish**.
174-
4. If you see the following screen, select **Start**.
175-
176-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/start-publish-button.png" alt-text="Start button in the Publish section.":::
177-
5. In the **Publish** dialog box, select **Azure** for **Target**, and select **Next**.
178-
6. Select **Azure Function App (Windows)**, and select **Next**.
179-
7. On the **Functions instance** tab, select your Azure subscription, expand the resource group, and select you function app, and then select **Finish**. You need to sign into your Azure account if you haven't already done so.
180-
181-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/publish-select-function-app.png" alt-text="Select your function app":::
182-
8. On the **Publish** page, in the **Service Dependencies** section, select **Configure** for **Storage**.
183-
184-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/publish-storage-configure-link.png" alt-text="Select configure link for storage service dependency":::
185-
1. On the **Configure dependency** page, follow these steps:
186-
1. select the **storage account** you created earlier, and then select **Next**.
187-
188-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/select-dependency-storage.png" alt-text="Select storage account":::
189-
10. Specify a **name for the connection string**, and select **None** for the **Save connection string** option, and then select **Next**.
190-
191-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/dependency-storage-connection-string.png" alt-text="Specify connection string name":::
192-
1. Clear the **Permissions for remote access** and **Secrets store** option, and then select **Finish**.
193-
194-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/dependency-storage-changes-summary.png" alt-text="Review summary of changes":::
195-
1. When Visual Studio has configured the profile, select **Publish**.
176+
4. In the following screen, select **Start** or **Add a publish profile**.
177+
5. In the **Publish** dialog box, select **Import Profile** for **Target**, and select **Next**.
196178
197-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/select-publish.png" alt-text="Select publish":::
198-
2. In the tab that has the **Azure Function** page open, select **Functions** on the left menu. Confirm that the **EventGridTriggerMigrateData** function shows up in the list. If you don't see it, try publishing from Visual Studio again, and then refresh the page in the portal.
179+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/import-profile.png" alt-text="Screenshot showing the selection **Import Profile** on the **Publish** dialog box.":::
180+
1. On the **Import profile** tab, select the publish settings file that you saved earlier in the **FunctionEGDWDumper** folder, and then select **Finish**.
181+
1. When Visual Studio has configured the profile, select **Publish**. Confirm that the publishing succeeded.
182+
2. In the web browser that has the **Azure Function** page open, select **Functions** on the left menu. Confirm that the **EventGridTriggerMigrateData** function shows up in the list. If you don't see it, try publishing from Visual Studio again, and then refresh the page in the portal.
199183
200-
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/confirm-function-creation.png" alt-text="Confirm function creation":::
184+
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/confirm-function-creation.png" alt-text="Screenshot showing the confirmation of function creation.":::
201185
202186
After publishing the function, you're ready to subscribe to the event.
203187
@@ -245,7 +229,7 @@ You've finished setting up your event hub, dedicate SQL pool (formerly SQL Data
245229
1. Right-click **WindTurbineDataGenerator** project, and select **Set as Startup project**.
246230
1. In the WindTurbineDataGenerator project, open **program.cs**.
247231
1. Replace `<EVENT HUBS NAMESPACE CONNECTION STRING>` with the connection string you copied from the portal.
248-
1. Replace `<EVENT HUB NAME>` with the name of the event hub.
232+
1. If you've used a different name for the event hub other than `hubdatamigration`, replace `<EVENT HUB NAME>` with the name of the event hub.
249233
250234
```cs
251235
private const string EventHubConnectionString = "Endpoint=sb://demomigrationnamespace.servicebus.windows.net/...";
7.12 KB
Loading
37.5 KB
Loading
18.1 KB
Loading
86.8 KB
Loading

articles/event-hubs/store-captured-data-data-warehouse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Tutorial: Migrate event data to Azure Synapse Analytics - Azure Event Hubs'
33
description: Describes how to use Azure Event Grid and Functions to migrate Event Hubs captured data to Azure Synapse Analytics.
44
services: event-hubs
5-
ms.date: 03/08/2022
5+
ms.date: 04/29/2022
66
ms.topic: tutorial
77
ms.custom: devx-track-csharp
88
---

0 commit comments

Comments
 (0)