Skip to content

Commit 3a1f0d8

Browse files
committed
updated
1 parent add39ec commit 3a1f0d8

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ Event Hubs [Capture](https://docs.microsoft.com/en-us/azure/event-hubs/event-hub
1111
In this tutorial, you do the following actions:
1212

1313
> [!div class="checklist"]
14-
> * Deploy infrastructure for this solution
1514
> * Create a table in SQL Data Warehouse
1615
> * Publish code to the Functions App
1716
> * Create an Event Grid subscription from the Functions app
1817
> * Stream sample data into Event Hub.
1918
> * Verify captured data in SQL Data Warehouse
2019
21-
# Prerequisites
20+
## Prerequisites
2221

2322
- [Visual studio 2017 Version 15.3.2 or greater](https://www.visualstudio.com/vs/). While installing, ensure that you install the following workloads: .NET desktop development, Azure development, ASP.NET and web development, Node.js development, Python development
2423
- Download the [Git sample](https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo). The sample solution contains the following components:
2524
- *WindTurbineDataGenerator* – A simple publisher that sends sample wind turbine data to a Capture-enabled event hub
2625
- *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 a SQL Data Warehouse.
2726

28-
## Deploy the infrastructure
27+
### Deploy the infrastructure
2928
Deploy the infrastructure needed for this tutorial by using this [Azure Resource Manager template](https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/EventHubsDataMigration.json). This template creates the following resources:
3029

3130
- Event Hub with the Capture feature enabled
@@ -35,7 +34,20 @@ Deploy the infrastructure needed for this tutorial by using this [Azure Resource
3534
- SQL Server for hosting the Data Warehouse
3635
- SQL Data Warehouse for storing the migrated data
3736

37+
The following sections provide Azure CLI and Azure PowerShell commands for deploying the infrastructure required for the tutorial. Update names of the following objects before running the commands:
3838

39+
- Azure resource group
40+
- Event Hubs namespace
41+
- Event hub
42+
- Azure SQL server
43+
- SQL user (and password)
44+
- Azure SQL database
45+
- Azure Storage
46+
- Azure Functions App
47+
48+
These scripts take a while to create all the Azure artifcts. Wait until the script completes before proceeding further.
49+
50+
#### Azure CLI
3951
To deploy the template using Azure CLI, use the following commands:
4052

4153
```azurecli-interactive
@@ -46,6 +58,8 @@ az group deployment create \
4658
--template-uri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/EventHubsDataMigration.json \
4759
--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>
4860
```
61+
62+
#### Azure PowerShell
4963
To deploy the template using PowerShell, use the following commands:
5064

5165
```powershell
@@ -55,7 +69,18 @@ New-AzureRmResourceGroupDeployment -ResourceGroupName rgDataMigration -TemplateU
5569
```
5670

5771
## Create a table in SQL Data Warehouse
58-
Create a table in your SQL data warehouse by running the *CreateDataWarehouseTable.sql* script using Visual Studio or the Query Editor in the portal.
72+
Create a table in your SQL data warehouse by running the [CreateDataWarehouseTable.sql](https://github.com/Azure/azure-event-hubs/blob/master/samples/e2e/EventHubsCaptureEventGridDemo/scripts/CreateDataWarehouseTable.sql) script using Visual Studio or the Query Editor in the portal.
73+
74+
```sql
75+
CREATE TABLE [dbo].[Fact_WindTurbineMetrics] (
76+
[DeviceId] nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
77+
[MeasureTime] datetime NULL,
78+
[GeneratedPower] float NULL,
79+
[WindSpeed] float NULL,
80+
[TurbineSpeed] float NULL
81+
)
82+
WITH (CLUSTERED COLUMNSTORE INDEX, DISTRIBUTION = ROUND_ROBIN);
83+
```
5984

6085
## Publish code to the Functions App
6186

0 commit comments

Comments
 (0)