Skip to content

Commit

Permalink
enable app insights in example api
Browse files Browse the repository at this point in the history
  • Loading branch information
nruffing committed Nov 23, 2023
1 parent 8bbf8c7 commit ca0b026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions DataGridVueDotnetExample/DataGridVueDotnetExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="XmlDocMarkdown.Core" Version="2.9.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions DataGridVueDotnetExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Reflection;
using DataGridVueDotnetExample.Data;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.EntityFrameworkCore;

namespace DataGridVueDotnetExample
Expand All @@ -13,6 +14,11 @@ public static void Main(string[] args)
builder.Logging.ClearProviders();
builder.Logging.AddConsole();

if (builder.Environment.IsDevelopment() == false)
{
builder.Services.AddApplicationInsightsTelemetry();
}

// Add services to the container.

builder.Services.AddControllers();
Expand Down

0 comments on commit ca0b026

Please sign in to comment.