You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-grid/includes/event-grid-event-hubs-functions-synapse-analytics.md
+41-57Lines changed: 41 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: event-grid
5
5
author: spelluru
6
6
ms.service: event-grid
7
7
ms.topic: include
8
-
ms.date: 12/07/2020
8
+
ms.date: 04/29/2022
9
9
ms.author: spelluru
10
10
ms.custom: "include file"
11
11
@@ -16,8 +16,8 @@ ms.custom: "include file"
16
16
This diagram depicts the workflow of the solution you build in this tutorial:
17
17
18
18
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.
21
21
4. The function app uses the blob URL in the event data to retrieve the blob from the storage.
22
22
5. The function app migrates the blob data to an Azure Synapse Analytics.
23
23
@@ -34,10 +34,10 @@ In this article, you take the following steps:
34
34
To complete this tutorial, you must have:
35
35
36
36
- 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.
38
38
- Download the [EventHubsCaptureEventGridDemo sample project](https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo) to your computer.
39
39
- 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).
41
41
42
42
## Deploy the infrastructure
43
43
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
54
54
1. Sign in to the [Azure portal](https://portal.azure.com).
:::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.":::
58
58
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.":::
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.
63
65
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.":::
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.
113
116
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.
114
117
115
118
### Verify that the resources are created
@@ -118,18 +121,18 @@ In this step, you deploy the required infrastructure with a [Resource Manager te
118
121
2. Filter the list of resource groups by entering the name of your resource group in the search box.
119
122
3. Select your resource group in the list.
120
123
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.":::
122
125
4. Confirm that you see the following resources in the resource group:
123
126
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":::
125
128
126
129
### 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.
128
131
129
132
1. In the list of resources in the resource group, select your **dedicated SQL pool**.
130
133
2. On the **Dedicated SQL pool** page, in the **Common Tasks** section on the left menu, select **Query editor (preview)**.
:::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.":::
133
136
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:
134
137
1. Select the link: **Set server firewall**.
135
138
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
149
152
WITH (CLUSTERED COLUMNSTORE INDEX, DISTRIBUTION = ROUND_ROBIN);
:::image type="content" source="media/event-grid-event-hubs-functions-synapse-analytics/run-sql-query.png" alt-text="Screenshot showing the query editor.":::
153
156
5. Keep this tab or window open so that you can verify that the data is created at the end of the tutorial.
154
157
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.
156
160
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
164
162
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.
168
164
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
170
172
171
173
1. Launch Visual Studio.
172
174
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.
173
175
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**.
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.
199
183
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.":::
201
185
202
186
After publishing the function, you're ready to subscribe to the event.
203
187
@@ -245,7 +229,7 @@ You've finished setting up your event hub, dedicate SQL pool (formerly SQL Data
245
229
1. Right-click **WindTurbineDataGenerator** project, and select **Set as Startup project**.
246
230
1. In the WindTurbineDataGenerator project, open **program.cs**.
247
231
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.
0 commit comments