diff --git a/src/Fusion.Summary.Api/Deployment/k8s/deployment-pr-env.yml b/src/Fusion.Summary.Api/Deployment/k8s/deployment-pr-env.yml index 37fc506b2..2f133913d 100644 --- a/src/Fusion.Summary.Api/Deployment/k8s/deployment-pr-env.yml +++ b/src/Fusion.Summary.Api/Deployment/k8s/deployment-pr-env.yml @@ -66,8 +66,6 @@ spec: value: "{{clientId}}" - name: BuildNr value: "{{buildNr}}" - - name: ConnectionStrings__SummaryDbContext - value: "{{dbConnectionString}}" args: - /server diff --git a/src/Fusion.Summary.Api/Program.cs b/src/Fusion.Summary.Api/Program.cs index 9b1472ec2..9da909918 100644 --- a/src/Fusion.Summary.Api/Program.cs +++ b/src/Fusion.Summary.Api/Program.cs @@ -38,9 +38,8 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddHealthChecks() .AddCheck("liveness", () => HealthCheckResult.Healthy()) - .AddCheck("db", () => HealthCheckResult.Healthy(), tags: ["ready"]); -// TODO: Add a real health check, when database is added in deployment pipelines and PR pipelines -// .AddDbContextCheck("db", tags: new[] { "ready" }); + .AddCheck("db", () => HealthCheckResult.Healthy(), tags: ["ready"]) + .AddDbContextCheck("db", tags: new[] { "ready" }); builder.Services .AddAuthentication(JwtBearerDefaults.AuthenticationScheme) @@ -118,6 +117,14 @@ #endregion Health probes +// TESTING +using var scope = app.Services.CreateScope(); +var dbContext = scope.ServiceProvider.GetRequiredService(); +Console.WriteLine(dbContext.Database.GetConnectionString()); + +// TESTING + + app.Run(); ///