From 686536106951df102e1f18f4e5d126c8898b502e Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Wed, 8 Mar 2023 23:56:16 +1000 Subject: [PATCH] Added back AppInsights --- src/ServerManager.WebApplication/Program.cs | 5 ----- .../ServerManager.WebApplication.csproj | 2 +- src/ServerManager.WebApplication/Startup.cs | 1 + .../appsettings.Development.json | 3 +++ 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ServerManager.WebApplication/Program.cs b/src/ServerManager.WebApplication/Program.cs index ecedb6c9..987d9163 100644 --- a/src/ServerManager.WebApplication/Program.cs +++ b/src/ServerManager.WebApplication/Program.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace ServerManager.WebApplication; @@ -17,8 +16,4 @@ public class Program { webBuilder.UseStartup(); }); - //.ConfigureLogging((hostingContext, options) => - //{ - // options.AddApplicationInsights(); - //}); } diff --git a/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj b/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj index 47db490b..e6e58b0e 100644 --- a/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj +++ b/src/ServerManager.WebApplication/ServerManager.WebApplication.csproj @@ -16,9 +16,9 @@ + - diff --git a/src/ServerManager.WebApplication/Startup.cs b/src/ServerManager.WebApplication/Startup.cs index cf7cf016..2b9ac13b 100644 --- a/src/ServerManager.WebApplication/Startup.cs +++ b/src/ServerManager.WebApplication/Startup.cs @@ -57,6 +57,7 @@ public class Startup }); services.AddHealthChecks(); + services.AddApplicationInsightsTelemetry(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/ServerManager.WebApplication/appsettings.Development.json b/src/ServerManager.WebApplication/appsettings.Development.json index 674f186f..b9619833 100644 --- a/src/ServerManager.WebApplication/appsettings.Development.json +++ b/src/ServerManager.WebApplication/appsettings.Development.json @@ -11,6 +11,9 @@ } } }, + "ApplicationInsights": { + "InstrumentationKey": "" + }, "EnableSwagger": true, "SwaggerRoutePrefix": "",