You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please, fill the following sections to help us fix the issue
What happened: TLDR: The code that works out full paths from relative paths for the healthcheck in the healthcheck-ui isn't quite working when deployed as an App Service in Azure. This results in a "System.Net.Sockets.SocketException" "No such host is known." every time the UI calls the healthcheck.
"HealthChecksUI": {
"HealthChecks": [
{
"Name": "HealthChecksService",
"Uri": "/healthcheck"
}
],
"Webhooks": [],
"EvaluationTimeinSeconds": 10
},
GetHealthReport threw an exception when trying to get report from /healthcheck configured with name HealthChecksService.
This results in the UI failing to pull any health report.
What you expected to happen: I'd expect a health report.
How to reproduce it (as minimally and precisely as possible):
Use a config like above.
Deploy to Azure as an App Service.
Source code sample: I can create a sample if needed, but even the samples will do the same.
Anything else we need to know?: I am specifically using 3.1.3 of the libraries. Since it's Azure and an App Service it's not using Kestrel, it's using IIS.
I pulled down the code for 3.1.3, removed the nuget references and added UI, UI.Client, and UI.Core to my project and added it as a project reference, cleaning that up to build in our project and aligning .Net Core libraries and references. I also modified:
HealthChecks.UI
Core/HostedService/HealthCheckReportCollector.cs
private async Task GetHealthReport(HealthCheckConfiguration configuration)
in the exception to be a little more useful:
108: _logger.LogError(exception, $"GetHealthReport threw an exception when trying to get report from {uri} configured with name {name}: absoluteUri: {absoluteUri}.");
... by adding the Uri it's trying to use after working out the relative paths.
Please, fill the following sections to help us fix the issue
What happened: TLDR: The code that works out full paths from relative paths for the healthcheck in the healthcheck-ui isn't quite working when deployed as an App Service in Azure. This results in a "System.Net.Sockets.SocketException" "No such host is known." every time the UI calls the healthcheck.
"HealthChecksUI": {
"HealthChecks": [
{
"Name": "HealthChecksService",
"Uri": "/healthcheck"
}
],
"Webhooks": [],
"EvaluationTimeinSeconds": 10
},
GetHealthReport threw an exception when trying to get report from /healthcheck configured with name HealthChecksService.
This results in the UI failing to pull any health report.
What you expected to happen: I'd expect a health report.
How to reproduce it (as minimally and precisely as possible):
Source code sample: I can create a sample if needed, but even the samples will do the same.
Anything else we need to know?: I am specifically using 3.1.3 of the libraries. Since it's Azure and an App Service it's not using Kestrel, it's using IIS.
I pulled down the code for 3.1.3, removed the nuget references and added UI, UI.Client, and UI.Core to my project and added it as a project reference, cleaning that up to build in our project and aligning .Net Core libraries and references. I also modified:
HealthChecks.UI
Core/HostedService/HealthCheckReportCollector.cs
private async Task GetHealthReport(HealthCheckConfiguration configuration)
in the exception to be a little more useful:
108: _logger.LogError(exception, $"GetHealthReport threw an exception when trying to get report from {uri} configured with name {name}: absoluteUri: {absoluteUri}.");
... by adding the Uri it's trying to use after working out the relative paths.
What's happening is this:
We have an east and west and the Azure generated URL for each is this:
https://oursite-dev-east-site.azurewebsites.net/
https://oursite-dev-west-site.azurewebsites.net/
So, I'd expect when I use /healthcheck I'd get:
https://oursite-dev-east-site.azurewebsites.net/healthcheck
https://oursite-dev-west-site.azurewebsites.net/healthcheck
But in fact, the relative path is being worked out as:
https://oursite-dev-east-site/healthcheck
https://oursite-dev-west-site/healthcheck
It's missing ".azurewebsites.net" so the httpclient is failing with "No Such Host."
**I'd recommend adding absoluteUri to the error logging as that's clearly something that's needed here when things fail.
Environment: Azure East/West typical App Service deployment.
The text was updated successfully, but these errors were encountered: