Merge pull request #11 from ncblakely/users/tos/healthcheck

Enable health checks.
This commit is contained in:
ncblakely 2022-09-05 21:54:19 -07:00 committed by GitHub
commit 00d1d374c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -47,8 +47,6 @@ namespace Giants.Web
services.AddApplicationInsightsTelemetry(); services.AddApplicationInsightsTelemetry();
IdentityModelEventSource.ShowPII = true;
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(options => .AddMicrosoftIdentityWebApi(options =>
{ {
@ -94,14 +92,17 @@ namespace Giants.Web
IMapper mapper = Services.Mapper.GetMapper(); IMapper mapper = Services.Mapper.GetMapper();
services.AddSingleton(mapper); services.AddSingleton(mapper);
services.AddHealthChecks();
builder.Logging.AddEventSourceLogger(); builder.Logging.AddEventSourceLogger();
builder.Logging.AddApplicationInsights();
} }
private static void ConfigureApplication(WebApplication app, IWebHostEnvironment env) private static void ConfigureApplication(WebApplication app, IWebHostEnvironment env)
{ {
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; IdentityModelEventSource.ShowPII = true;
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
app.UseOpenApi(); app.UseOpenApi();
} }
@ -113,11 +114,12 @@ namespace Giants.Web
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
{ {
endpoints.MapControllers(); endpoints.MapControllers();
}); });
app.MapHealthChecks("/health");
} }
} }
} }