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
// Copyright (c) Microsoft Corporation. All rights reserved.
2
+
// Licensed under the MIT License.
3
+
4
+
usingSystem;
5
+
usingSystem.Collections.Generic;
6
+
usingSystem.IO;
7
+
usingSystem.Text;
8
+
usingSystem.Threading;
9
+
usingSystem.Threading.Tasks;
10
+
usingAzure.Messaging.EventHubs;
11
+
usingAzure.Messaging.EventHubs.Processor;
12
+
usingAzure.Storage.Blobs;
13
+
usingMicrosoft.Extensions.Azure;
14
+
usingMicrosoft.Extensions.Configuration;
15
+
usingMicrosoft.Extensions.Hosting;
16
+
usingMicrosoft.Extensions.Logging;
17
+
18
+
namespaceLineCounter
19
+
{
20
+
/// <summary>
21
+
/// Hosted service that listens to uploads events hub and calculates line counts for the blobs in background updating blob metadata and posting a message into results event hub
Sample that uses illustrates using blob and event hub clients along with ASP.NET Core integration, distributed tracing and hosted services.
4
+
5
+
# Configuration
6
+
7
+
To run the sample set the following configuration properties using manage user secrets command in VS or user secrets command line https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-2.2&tabs=windows#set-a-secret
8
+
9
+
```json
10
+
{
11
+
"Blob": {
12
+
"connectionString": "..."
13
+
},
14
+
"Uploads": {
15
+
"connectionString": "...",
16
+
"eventHubName": "..."
17
+
},
18
+
"Results": {
19
+
"connectionString": "...",
20
+
"eventHubName": "..."
21
+
}
22
+
}
23
+
```
24
+
25
+
To light up App Insights, add the InstrumentationKey key and value to the ApplicationInsights node in appsettings.json
0 commit comments