【发布时间】:2019-04-11 04:03:36
【问题描述】:
我已经阅读了发行说明 https://steeltoe.io/reference/reference-release-notes/#2-2-0 并有兴趣通过 http 公开 /health 端点(我的意思是在 PCF 应用程序管理器之外)。我在 appsettings.json 中有以下设置
{
"management": {
"endpoints": {
"path": "/cloudfoundryapplication",
"cloudfoundry": {
"validateCertificates": false
},
"health": {
"showdetails": "always",
"claim": {
"type": "health_actuator",
"value": "see_details"
}
}
}
}
}
我的项目引用了 Steeltoe.Management.CloudFoundryCore V2.2.0,我的启动如下所示
public void ConfigureServices(IServiceCollection services)
{
// Add health actuator
services.AddHealthActuator(configuration);
services.AddCloudFoundryActuators(Configuration);
}
public void Configure(IApplicationBuilder app)
{
if (HostingEnvironment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCloudFoundryActuators();
app.UseHealthChecks();
app.UseMvc();
}
现在,当我尝试调用 url https://myservice/cloudfoundryapplication/health 时,我收到一个 401 错误,提示 {"security_error":"Authorization header is missing or invalid"}。知道这里可能有什么问题。
【问题讨论】:
标签: asp.net-core steeltoe