添加健康检查相关包并配置NpgSql健康检查和UI
This commit is contained in:
parent
0589c29e5d
commit
5117927e5e
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.UI.PostgreSQL.Storage" Version="9.0.0" />
|
||||||
<PackageReference Include="Auth0.ManagementApi" Version="7.38.0" />
|
<PackageReference Include="Auth0.ManagementApi" Version="7.38.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.17" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.17" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="9.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="9.0.6" />
|
||||||
|
@ -66,7 +66,8 @@ builder.Services.Configure<JwtBearerOptions>(options =>
|
|||||||
{
|
{
|
||||||
options.TokenValidationParameters.RoleClaimType = ClaimTypes.Role;
|
options.TokenValidationParameters.RoleClaimType = ClaimTypes.Role;
|
||||||
});
|
});
|
||||||
|
builder.Services.AddHealthChecks().AddNpgSql(builder.Configuration.GetConnectionString("DBContext"));
|
||||||
|
builder.Services.AddHealthChecksUI();
|
||||||
builder.Services.Configure<JWTOptions>(builder.Configuration.GetSection("JWT"));
|
builder.Services.Configure<JWTOptions>(builder.Configuration.GetSection("JWT"));
|
||||||
|
|
||||||
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user