Updating the sample to use latest packages
This commit is contained in:
Родитель
7028e2d1cb
Коммит
882873d51c
|
@ -1,37 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30128.36
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunctionEGDWDumper", "FunctionEGDWDumper\FunctionEGDWDumper.csproj", "{E29F9E83-073D-4371-929A-A1A045B9596E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DWDumper", "DWDumper\DWDumper.csproj", "{C9E1D3C8-0C0D-45EB-A3B5-15F95EFC01E3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindTurbineDataGenerator", "WindTurbineDataGenerator\WindTurbineDataGenerator.csproj", "{0C87A54A-AD21-46D5-8B75-4247DA32237E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E29F9E83-073D-4371-929A-A1A045B9596E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E29F9E83-073D-4371-929A-A1A045B9596E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E29F9E83-073D-4371-929A-A1A045B9596E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E29F9E83-073D-4371-929A-A1A045B9596E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9E1D3C8-0C0D-45EB-A3B5-15F95EFC01E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9E1D3C8-0C0D-45EB-A3B5-15F95EFC01E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9E1D3C8-0C0D-45EB-A3B5-15F95EFC01E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9E1D3C8-0C0D-45EB-A3B5-15F95EFC01E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CABDAC3A-BADD-423D-B33B-983C7CBD0F46}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.1.32407.343
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindTurbineDataGenerator", "WindTurbineDataGenerator\WindTurbineDataGenerator.csproj", "{0C87A54A-AD21-46D5-8B75-4247DA32237E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionEGDWDumper", "FunctionEGDWDumper\FunctionEGDWDumper.csproj", "{231010C2-FC1F-4393-ABD6-4209523A652B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C87A54A-AD21-46D5-8B75-4247DA32237E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{231010C2-FC1F-4393-ABD6-4209523A652B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{231010C2-FC1F-4393-ABD6-4209523A652B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{231010C2-FC1F-4393-ABD6-4209523A652B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{231010C2-FC1F-4393-ABD6-4209523A652B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CABDAC3A-BADD-423D-B33B-983C7CBD0F46}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
namespace FunctionEGDWDumper
|
||||
{
|
||||
/// <summary>
|
||||
/// These classes were generated from the EventGrid event schema.
|
||||
/// <see cref="DWDumperFunction1"/> comments for understanding how the EventGrid schema was obtained.
|
||||
/// </summary>
|
||||
public class EventGridEHEvent
|
||||
{
|
||||
public string topic { get; set; }
|
||||
public string subject { get; set; }
|
||||
public string eventType { get; set; }
|
||||
public string eventTime { get; set; }
|
||||
public string id { get; set; }
|
||||
public Data data { get; set; }
|
||||
}
|
||||
|
||||
public class Data
|
||||
{
|
||||
public string fileUrl { get; set; }
|
||||
public string fileType { get; set; }
|
||||
public string partitionId { get; set; }
|
||||
public int sizeInBytes { get; set; }
|
||||
public int eventCount { get; set; }
|
||||
public int firstSequenceNumber { get; set; }
|
||||
public int lastSequenceNumber { get; set; }
|
||||
public string firstEnqueueTime { get; set; }
|
||||
public string lastEnqueueTime { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,153 +1,152 @@
|
|||
// This is the default URL for triggering event grid function in the local environment.
|
||||
// http://localhost:7071/admin/extensions/EventGridExtensionConfig?functionName={functionname}
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Avro.File;
|
||||
using Avro.Generic;
|
||||
using Microsoft.Azure.WebJobs;
|
||||
using Microsoft.Azure.WebJobs.Extensions.EventGrid;
|
||||
using Microsoft.Azure.WebJobs.Extensions.Http;
|
||||
using Microsoft.Azure.WebJobs.Host;
|
||||
using Azure.Storage.Blobs;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace FunctionEGDWDumper
|
||||
{
|
||||
|
||||
public static class Function1
|
||||
{
|
||||
private static readonly string StorageConnectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
|
||||
private static readonly string SqlDwConnection = Environment.GetEnvironmentVariable("SqlDwConnection");
|
||||
|
||||
/// <summary>
|
||||
/// Use the accompanying .sql script to create this table in the data warehouse
|
||||
/// </summary>
|
||||
private const string TableName = "dbo.Fact_WindTurbineMetrics";
|
||||
|
||||
[FunctionName("EventGridTriggerMigrateData")]
|
||||
public static void Run([EventGridTrigger]JObject eventGridEvent, TraceWriter log)
|
||||
{
|
||||
log.Info("C# EventGrid trigger function processed a request.");
|
||||
log.Info(eventGridEvent.ToString(Formatting.Indented));
|
||||
|
||||
try
|
||||
{
|
||||
// Copy to a static Album instance
|
||||
EventGridEHEvent ehEvent = eventGridEvent.ToObject<EventGridEHEvent>();
|
||||
|
||||
// Get the URL from the event that points to the Capture file
|
||||
var uri = new Uri(ehEvent.data.fileUrl);
|
||||
|
||||
// Get data from the file and migrate to data warehouse
|
||||
Dump(uri);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string s = string.Format(CultureInfo.InvariantCulture,
|
||||
"Error processing request. Exception: {0}, Request: {1}", e, eventGridEvent.ToString());
|
||||
log.Error(s);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dumps the data from the Avro blob to the data warehouse (DW).
|
||||
/// Before running this, ensure that the DW has the required <see cref="TableName"/> table created.
|
||||
/// </summary>
|
||||
private static async void Dump(Uri fileUri)
|
||||
{
|
||||
// Get the blob reference
|
||||
BlobClient blob = new BlobClient(fileUri);
|
||||
|
||||
using (var dataTable = GetWindTurbineMetricsTable())
|
||||
{
|
||||
// Parse the Avro File
|
||||
Stream blobStream = await blob.OpenReadAsync(null);
|
||||
using (var avroReader = DataFileReader<GenericRecord>.OpenReader(blobStream))
|
||||
{
|
||||
while (avroReader.HasNext())
|
||||
{
|
||||
GenericRecord r = avroReader.Next();
|
||||
|
||||
byte[] body = (byte[])r["Body"];
|
||||
var windTurbineMeasure = DeserializeToWindTurbineMeasure(body);
|
||||
|
||||
// Add the row to in memory table
|
||||
AddWindTurbineMetricToTable(dataTable, windTurbineMeasure);
|
||||
}
|
||||
}
|
||||
|
||||
if (dataTable.Rows.Count > 0)
|
||||
{
|
||||
BatchInsert(dataTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open connection to data warehouse. Write the parsed data to the table.
|
||||
/// </summary>
|
||||
private static void BatchInsert(DataTable table)
|
||||
{
|
||||
// Write the data to SQL DW using SqlBulkCopy
|
||||
using (var sqlDwConnection = new SqlConnection(SqlDwConnection))
|
||||
{
|
||||
sqlDwConnection.Open();
|
||||
|
||||
using (var bulkCopy = new SqlBulkCopy(sqlDwConnection))
|
||||
{
|
||||
bulkCopy.BulkCopyTimeout = 30;
|
||||
bulkCopy.DestinationTableName = TableName;
|
||||
bulkCopy.WriteToServer(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize data and return object with expected properties.
|
||||
/// </summary>
|
||||
private static WindTurbineMeasure DeserializeToWindTurbineMeasure(byte[] body)
|
||||
{
|
||||
string payload = Encoding.ASCII.GetString(body);
|
||||
return JsonConvert.DeserializeObject<WindTurbineMeasure>(payload);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define the in-memory table to store the data. The columns match the columns in the .sql script.
|
||||
/// </summary>
|
||||
private static DataTable GetWindTurbineMetricsTable()
|
||||
{
|
||||
var dt = new DataTable();
|
||||
dt.Columns.AddRange
|
||||
(
|
||||
new DataColumn[5]
|
||||
{
|
||||
new DataColumn("DeviceId", typeof(string)),
|
||||
new DataColumn("MeasureTime", typeof(DateTime)),
|
||||
new DataColumn("GeneratedPower", typeof(float)),
|
||||
new DataColumn("WindSpeed", typeof(float)),
|
||||
new DataColumn("TurbineSpeed", typeof(float))
|
||||
}
|
||||
);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For each parsed record, add a row to the in-memory table.
|
||||
/// </summary>
|
||||
private static void AddWindTurbineMetricToTable(DataTable table, WindTurbineMeasure wtm)
|
||||
{
|
||||
table.Rows.Add(wtm.DeviceId, wtm.MeasureTime, wtm.GeneratedPower, wtm.WindSpeed, wtm.TurbineSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Default URL for triggering event grid function in the local environment.
|
||||
// http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
|
||||
using System;
|
||||
using Microsoft.Azure.WebJobs;
|
||||
using Microsoft.Azure.WebJobs.Extensions.EventGrid;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Avro.File;
|
||||
using Avro.Generic;
|
||||
using Azure.Storage.Blobs;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using Azure.Messaging.EventGrid;
|
||||
using Azure;
|
||||
using Azure.Storage;
|
||||
|
||||
namespace FunctionEGDWDumper
|
||||
{
|
||||
public static class Function1
|
||||
{
|
||||
private static readonly string StorageAccountName = Environment.GetEnvironmentVariable("StorageAccountName");
|
||||
private static readonly string StorageAccessKey = Environment.GetEnvironmentVariable("StorageAccessKey");
|
||||
private static readonly string SqlDwConnection = Environment.GetEnvironmentVariable("SqlDwConnection");
|
||||
|
||||
/// <summary>
|
||||
/// Use the accompanying .sql script to create this table in the data warehouse
|
||||
/// </summary>
|
||||
private const string TableName = "dbo.Fact_WindTurbineMetrics";
|
||||
|
||||
[FunctionName("MyEventGridTriggerMigrateData")]
|
||||
public static void Run([EventGridTrigger]EventGridEvent eventGridEvent, ILogger log)
|
||||
{
|
||||
log.LogInformation("C# EventGrid trigger function processed a request.");
|
||||
log.LogInformation(eventGridEvent.Data.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
// Get the URL from the event that points to the Capture file
|
||||
Data data = eventGridEvent.Data.ToObjectFromJson<Data>();
|
||||
var uri = new Uri(data.fileUrl);
|
||||
log.LogInformation($"file URL: {data.fileUrl}");
|
||||
|
||||
// Get data from the file and migrate to data warehouse
|
||||
Dump(uri, log);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string s = string.Format(CultureInfo.InvariantCulture,
|
||||
"Error processing request. Exception: {0}, Request: {1}", e, eventGridEvent.ToString());
|
||||
log.LogError(s);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dumps the data from the Avro blob to the data warehouse (DW).
|
||||
/// Before running this, ensure that the DW has the required <see cref="TableName"/> table created.
|
||||
/// </summary>
|
||||
private static async void Dump(Uri fileUri, ILogger log)
|
||||
{
|
||||
// Get the blob reference
|
||||
BlobClient blob = new BlobClient(fileUri, new StorageSharedKeyCredential(StorageAccountName, StorageAccessKey));
|
||||
|
||||
using (var dataTable = GetWindTurbineMetricsTable())
|
||||
{
|
||||
// Parse the Avro File
|
||||
Stream blobStream = await blob.OpenReadAsync(null);
|
||||
using (var avroReader = DataFileReader<GenericRecord>.OpenReader(blobStream))
|
||||
{
|
||||
while (avroReader.HasNext())
|
||||
{
|
||||
GenericRecord r = avroReader.Next();
|
||||
|
||||
byte[] body = (byte[])r["Body"];
|
||||
var windTurbineMeasure = DeserializeToWindTurbineMeasure(body);
|
||||
|
||||
// Add the row to in memory table
|
||||
AddWindTurbineMetricToTable(dataTable, windTurbineMeasure);
|
||||
}
|
||||
}
|
||||
|
||||
if (dataTable.Rows.Count > 0)
|
||||
{
|
||||
log.LogInformation("Batch insert into the dedicated SQL pool.");
|
||||
BatchInsert(dataTable, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open connection to data warehouse. Write the parsed data to the table.
|
||||
/// </summary>
|
||||
private static void BatchInsert(DataTable table, ILogger log)
|
||||
{
|
||||
// Write the data to SQL DW using SqlBulkCopy
|
||||
using (var sqlDwConnection = new SqlConnection(SqlDwConnection))
|
||||
{
|
||||
sqlDwConnection.Open();
|
||||
|
||||
log.LogInformation("Bulk copying data.");
|
||||
using (var bulkCopy = new SqlBulkCopy(sqlDwConnection))
|
||||
{
|
||||
bulkCopy.BulkCopyTimeout = 30;
|
||||
bulkCopy.DestinationTableName = TableName;
|
||||
bulkCopy.WriteToServer(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize data and return object with expected properties.
|
||||
/// </summary>
|
||||
private static WindTurbineMeasure DeserializeToWindTurbineMeasure(byte[] body)
|
||||
{
|
||||
string payload = Encoding.ASCII.GetString(body);
|
||||
return JsonConvert.DeserializeObject<WindTurbineMeasure>(payload);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define the in-memory table to store the data. The columns match the columns in the .sql script.
|
||||
/// </summary>
|
||||
private static DataTable GetWindTurbineMetricsTable()
|
||||
{
|
||||
var dt = new DataTable();
|
||||
dt.Columns.AddRange
|
||||
(
|
||||
new DataColumn[5]
|
||||
{
|
||||
new DataColumn("DeviceId", typeof(string)),
|
||||
new DataColumn("MeasureTime", typeof(DateTime)),
|
||||
new DataColumn("GeneratedPower", typeof(float)),
|
||||
new DataColumn("WindSpeed", typeof(float)),
|
||||
new DataColumn("TurbineSpeed", typeof(float))
|
||||
}
|
||||
);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For each parsed record, add a row to the in-memory table.
|
||||
/// </summary>
|
||||
private static void AddWindTurbineMetricToTable(DataTable table, WindTurbineMeasure wtm)
|
||||
{
|
||||
table.Rows.Add(wtm.DeviceId, wtm.MeasureTime, wtm.GeneratedPower, wtm.WindSpeed, wtm.TurbineSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
|
||||
<UserSecretsId>c542a7d9-5d67-443a-b50f-0ea02bd96fcd</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Apache.Avro" Version="1.9.2" />
|
||||
<PackageReference Include="Azure.Storage.Blobs" Version="12.8.1" />
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="host.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="local.settings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Apache.Avro" Version="1.11.0" />
|
||||
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.10.0" />
|
||||
<PackageReference Include="Azure.Storage.Blobs" Version="12.12.0" />
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="3.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.1.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="host.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="local.settings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"version": "2.0",
|
||||
"logging": {
|
||||
"applicationInsights": {
|
||||
"samplingExcludedTypes": "Request",
|
||||
"samplingSettings": {
|
||||
"isEnabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"version": "2.0",
|
||||
"logging": {
|
||||
"applicationInsights": {
|
||||
"samplingSettings": {
|
||||
"isEnabled": true,
|
||||
"excludedTypes": "Request"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,143 +1,3 @@
|
|||
# Migrate Captured Event Hubs data to a SQL Data Warehouse using Event Grid and Azure Function
|
||||
# Migrate captured Event Hubs data to Azure Synapse Analytics using Event Grid and Azure Functions
|
||||
|
||||
Event Hubs [Capture](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-capture-overview) is the easiest way to automatically deliver streamed data in Event Hubs to an Azure Blob storage or Azure Data Lake store. You can subsequently process and deliver the data to any other storage destinations of your choice, such as SQL Data Warehouse or Cosmos DB. In this tutorial, we will demonstrate how you can pipe Captured data from your event hub into a SQL Database Warehouse by using an [Event Grid](https://docs.microsoft.com/azure/event-grid/overview) triggered Azure Function.
|
||||
|
||||
### What is covered in this tutorial:
|
||||
|
||||
![Visual Studio](./media/EventGridIntegrationOverview.PNG)
|
||||
|
||||
* First, we create an Azure Event Hub with Capture enabled and set an Azure blob storage as the destination. Data generated by WindTurbineGenerator will be streamed into the event hub and automatically Captured into Azure Storage as Avro files.
|
||||
* Next, we create an Azure Event Grid subscription with the Event Hubs namespace as its source and the Azure Function endpoint as its destination.
|
||||
* Whenever a new Avro file is delivered to the Storage blob by Event Hubs Capture, Event Grid notifies the Azure Function with the blob URI. The Function then does the required processing to migrate the data from the Storage blob to a SQL Database data warehouse.
|
||||
|
||||
There are no worker services involved in polling for these Avro files, which eliminates management overhead and significantly lower COGS, especially in a cloud-scale production environment!
|
||||
|
||||
This sample solution contains files that do the following:
|
||||
1. *WindTurbineDataGenerator* – A simple publisher that sends wind turbine data to a Capture-enabled event hub
|
||||
1. *FunctionDWDumper* – An Azure Function that receives an Event Grid notification 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.
|
||||
|
||||
# Prerequisites
|
||||
* [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
|
||||
|
||||
![Visual Studio](./media/EventCaptureGridDemo1.png)
|
||||
|
||||
# Detailed steps
|
||||
### Overview:
|
||||
1. Deploy the infrastructure for this solution
|
||||
2. Create a table in SQL Data Warehouse
|
||||
3. Publish code to the Functions App
|
||||
4. Create an Event Grid subscription from the Functions app, with your Event Hubs Namespace as the source and your Function endpoint as the destination.
|
||||
5. Run WindTurbineDataGenerator.exe to generate data streams to the Event Hub.
|
||||
6. Observe the Captured data that has been migrated to your SQL Data Warehouse table by the Azure Function
|
||||
|
||||
## 1. Deploy the infrastructure
|
||||
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 creates the following resources:
|
||||
- Event Hub with Capture enabled
|
||||
- Storage account for the files from Capture
|
||||
- Azure app service plan for hosting the Functions app
|
||||
- Function app for processing Captured event files (Function code to be added in Step 3)
|
||||
- SQL Server for hosting the Data Warehouse
|
||||
- SQL Data Warehouse for storing the migrated data (SQL table to be added in Step 2)
|
||||
To deploy the template using Azure CLI, use:
|
||||
|
||||
```azurecli-interactive
|
||||
az group create -l westcentralus -n rgDataMigrationSample
|
||||
|
||||
az group deployment create \
|
||||
--resource-group rgDataMigrationSample \
|
||||
--template-uri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/EventHubsDataMigration.json \
|
||||
--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>
|
||||
```
|
||||
To deploy the template using PowerShell, use:
|
||||
|
||||
```powershell
|
||||
New-AzureRmResourceGroup -Name rgDataMigration -Location westcentralus
|
||||
|
||||
New-AzureRmResourceGroupDeployment -ResourceGroupName rgDataMigration -TemplateUri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/event-grid/EventHubsDataMigration.json -eventHubNamespaceName <event-hub-namespace> -eventHubName hubdatamigration -sqlServerName <sql-server-name> -sqlServerUserName <user-name> -sqlServerDatabaseName <database-name> -storageName <unique-storage-name> -functionAppName <app-name>
|
||||
```
|
||||
|
||||
## 2. Create a table in SQL Data Warehouse
|
||||
Create a table in your Data Warehouse by running the *CreateDataWarehouseTable.sql* script using Visual Studio or the Query Editor in the portal.
|
||||
|
||||
## 3. Publish code to the Functions App
|
||||
|
||||
1. Open the project solution *EventHubsCaptureEventGridDemo.sln* in Visual Studio 2017 (15.3.2 or greater).
|
||||
|
||||
1. In Solution Explorer, right-click *FunctionEGDWDumper*, and select **Publish**.
|
||||
|
||||
![Publish function app](./media/publish-function-app.png)
|
||||
|
||||
1. Select **Azure Function App** and **Select Existing**. Select **Publish**.
|
||||
|
||||
![Target function app](./media/pick-target.png)
|
||||
|
||||
1. Select the function app that you deployed through the template. Select **OK**.
|
||||
|
||||
![Select function app](./media/select-function-app.png)
|
||||
|
||||
1. When Visual Studio has configured the profile, select **Publish**.
|
||||
|
||||
![Select publish](./media/select-publish.png)
|
||||
|
||||
After publishing the function, you are ready to subscribe to the Capture event!
|
||||
|
||||
|
||||
## 4. Create an Event Grid subscription from the Functions app
|
||||
|
||||
1. Go to the [Azure portal](https://portal.azure.com/). Select your resource group and function app.
|
||||
|
||||
![View function app](./media/view-function-app.png)
|
||||
|
||||
1. Select the function.
|
||||
|
||||
![Select function](./media/select-function.png)
|
||||
|
||||
1. Select **Add Event Grid subscription**.
|
||||
|
||||
![Add subscription](./media/add-event-grid-subscription.png)
|
||||
|
||||
1. Give the event grid subscription a name. Use **Event Hubs Namespaces** as the event type. Provide values to select your instance of the Event Hubs namespace. Leave the subscriber endpoint as the provided value. Select **Create**.
|
||||
|
||||
![Create subscription](./media/set-subscription-values.png)
|
||||
|
||||
## 5. Run WindTurbineDataGenerator.exe to generate data
|
||||
You have now set up your Event Hub, SQL data warehouse, Azure Function App, and Event Grid subscription. Upon completing the simple configuration below, you can run WindTurbineDataGenerator.exe to generate data streams to the Event Hub.
|
||||
|
||||
1. In the portal, select your event hub namespace. Select **Connection Strings**.
|
||||
|
||||
![Select connection strings](./media/event-hub-connection.png)
|
||||
|
||||
2. Select **RootManageSharedAccessKey**
|
||||
|
||||
![Select key](./media/show-root-key.png)
|
||||
|
||||
3. Copy **Connection string - primary Key**
|
||||
|
||||
![Copy key](./media/copy-key.png)
|
||||
|
||||
4. Go back to your Visual Studio project. In the *WindTurbineDataGenerator* project, open *program.cs*.
|
||||
|
||||
5. Replace the two constant values. Use the copied value for **EventHubConnectionString**. Use **hubdatamigration** the event hub name.
|
||||
|
||||
```cs
|
||||
private const string EventHubConnectionString = "Endpoint=sb://demomigrationnamespace.servicebus.windows.net/...";
|
||||
private const string EventHubName = "hubdatamigration";
|
||||
```
|
||||
|
||||
6. Build the solution, then run the WindTurbineGenerator.exe application.
|
||||
|
||||
## 6. Observe the Captured data migrate to your SQL Data Warehouse table
|
||||
After a couple of minutes, query the table in your data warehouse. You will observe that data generated by the WindTurbineDataGenerator has been streamed to your Event Hub, Captured into an Azure Storage container, and then migrated into the SQL data table by Azure Function.
|
||||
|
||||
## Next steps
|
||||
You can use powerful data visualization tools with your data warehouse to achieve your Actionable insights.
|
||||
|
||||
This article shows how to use [Power BI with SQL Data Warehouse](https://docs.microsoft.com/azure/sql-data-warehouse/sql-data-warehouse-integrate-power-bi)
|
||||
|
||||
Now you are all set to plug in the UI you need to get valuable business insights for your management.
|
||||
|
||||
# Conclusion
|
||||
We look forward to your feedback after you give this tutorial a try! We also love to see pull requests so if you would like to contribute to our community.
|
||||
|
||||
Stay tuned for more samples from the Azure Messaging team, and till next time!
|
||||
For detailed information about this sample, see the tutorial [Tutorial: Migrate captured Event Hubs data to Azure Synapse Analytics using Event Grid and Azure Functions](https://docs.microsoft.com/azure/event-hubs/store-captured-data-data-warehouse).
|
||||
|
|
|
@ -1,34 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Azure.Amqp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Azure.Amqp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
|
|
@ -16,13 +16,14 @@ namespace WindTurbineDataGenerator
|
|||
private const string EventHubConnectionString =
|
||||
"<EVENT HUBS NAMESPACE CONNECTION STRING>";
|
||||
|
||||
private const string EventHubName = "<EVENT HUB NAME>";
|
||||
private const string EventHubName = "hubdatamigration";
|
||||
|
||||
private static int Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Starting wind turbine generator. Press <ENTER> to exit");
|
||||
|
||||
// Start generation of events
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
|
||||
var t0 = StartEventGenerationAsync(cts.Token);
|
||||
|
|
|
@ -1,139 +1,157 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0C87A54A-AD21-46D5-8B75-4247DA32237E}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>WindTurbineDataGenerator</RootNamespace>
|
||||
<AssemblyName>WindTurbineDataGenerator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Azure.Core, Version=1.5.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.5.0\lib\net461\Azure.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Messaging.EventHubs, Version=5.2.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Messaging.EventHubs.5.2.0\lib\netstandard2.0\Azure.Messaging.EventHubs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Amqp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Azure.Amqp.2.4.5\lib\net45\Microsoft.Azure.Amqp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.WebSockets.4.0.0\lib\net46\System.Net.WebSockets.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets.Client, Version=4.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.WebSockets.Client.4.0.2\lib\net46\System.Net.WebSockets.Client.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.TypeExtensions.4.5.1\lib\net461\System.Reflection.TypeExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Runtime.Serialization.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.0.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.0.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.1.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Channels, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Channels.4.6.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindTurbineMeasure.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0C87A54A-AD21-46D5-8B75-4247DA32237E}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>WindTurbineDataGenerator</RootNamespace>
|
||||
<AssemblyName>WindTurbineDataGenerator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Azure.Core, Version=1.20.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.20.0\lib\net461\Azure.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Core.Amqp, Version=1.2.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.Amqp.1.2.0\lib\netstandard2.0\Azure.Core.Amqp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Messaging.EventHubs, Version=5.6.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Messaging.EventHubs.5.6.2\lib\netstandard2.0\Azure.Messaging.EventHubs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Amqp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Azure.Amqp.2.5.6\lib\net45\Microsoft.Azure.Amqp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.1.0\lib\net462\System.IO.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory.Data, Version=1.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.WebSockets.4.0.0\lib\net46\System.Net.WebSockets.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets.Client, Version=4.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.WebSockets.Client.4.0.2\lib\net46\System.Net.WebSockets.Client.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.TypeExtensions.4.5.1\lib\net461\System.Reflection.TypeExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Runtime.Serialization.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.0.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.0.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.1.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Channels, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Channels.4.6.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindTurbineMeasure.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,26 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Azure.Core" version="1.5.0" targetFramework="net461" />
|
||||
<package id="Azure.Messaging.EventHubs" version="5.4.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Azure.Amqp" version="2.4.5" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
||||
<package id="System.Buffers" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Memory" version="4.5.3" targetFramework="net461" />
|
||||
<package id="System.Net.WebSockets" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Net.WebSockets.Client" version="4.0.2" targetFramework="net461" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Reflection.TypeExtensions" version="4.5.1" targetFramework="net461" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.2.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.1.0" targetFramework="net461" />
|
||||
<package id="System.Text.Encodings.Web" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Text.Json" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Threading.Channels" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Azure.Core" version="1.20.0" targetFramework="net48" />
|
||||
<package id="Azure.Core.Amqp" version="1.2.0" targetFramework="net48" />
|
||||
<package id="Azure.Messaging.EventHubs" version="5.6.2" targetFramework="net48" />
|
||||
<package id="Microsoft.Azure.Amqp" version="2.5.6" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.IO" version="4.1.0" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.Memory.Data" version="1.0.2" targetFramework="net48" />
|
||||
<package id="System.Net.WebSockets" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Net.WebSockets.Client" version="4.0.2" targetFramework="net461" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Reflection.TypeExtensions" version="4.5.1" targetFramework="net461" />
|
||||
<package id="System.Runtime" version="4.1.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.2.0" targetFramework="net461" requireReinstallation="true" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.0.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.1.0" targetFramework="net461" />
|
||||
<package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net48" />
|
||||
<package id="System.Text.Json" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Threading.Channels" version="4.6.0" targetFramework="net461" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" requireReinstallation="true" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче