Skip to content

Commit

Permalink
Add Appinsights support in Copilot Chat (#709)
Browse files Browse the repository at this point in the history
### Motivation and Context
It is desired to monitor deployments of the Copilot Chat.

### Description
Add Application Insights telemetry and logging
  • Loading branch information
glahaye committed Apr 28, 2023
1 parent 970dfa3 commit 7af1b96
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions samples/apps/copilot-chat-app/webapi/CopilotChatApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.14" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.16" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.16" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.32.3" />
<PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.27.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions samples/apps/copilot-chat-app/webapi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public static async Task Main(string[] args)

// Add in the rest of the services.
builder.Services
.AddApplicationInsightsTelemetry()
.AddLogging(logBuilder => logBuilder.AddApplicationInsights())
.AddAuthorization(builder.Configuration)
.AddEndpointsApiExplorer()
.AddSwaggerGen()
Expand Down
9 changes: 8 additions & 1 deletion samples/apps/copilot-chat-app/webapi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,12 @@
"Microsoft.AspNetCore.Hosting": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},

//
// Application Insights configuration
//
"ApplicationInsights": {
"ConnectionString": ""
}
}
}

0 comments on commit 7af1b96

Please sign in to comment.