Skip to content

Commit

Permalink
enable telemetry client in deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi Kang committed Mar 30, 2020
1 parent 65b6643 commit 366054b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BotProject/Templates/CSharp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ public void ConfigureServices(IServiceCollection services)
var adapter = new BotFrameworkHttpAdapter(new ConfigurationCredentialProvider(this.Configuration));
adapter
.UseStorage(storage)
.UseState(userState, conversationState);
.UseState(userState, conversationState);

if (!string.IsNullOrEmpty(settings.AppInsights.InstrumentationKey))
{
adapter.Use(new TelemetryLoggerMiddleware(new BotTelemetryClient(new TelemetryClient()), true));
}

if (!string.IsNullOrEmpty(settings.BlobStorage.ConnectionString) && !string.IsNullOrEmpty(settings.BlobStorage.Container))
{
Expand Down

0 comments on commit 366054b

Please sign in to comment.