Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HealthCheckReportCollector fails GetHealthReportAsync on Azure #1779

Closed
Ericvf opened this issue Mar 31, 2023 · 4 comments · Fixed by #1787
Closed

HealthCheckReportCollector fails GetHealthReportAsync on Azure #1779

Ericvf opened this issue Mar 31, 2023 · 4 comments · Fixed by #1787
Assignees
Labels

Comments

@Ericvf
Copy link

Ericvf commented Mar 31, 2023

Hi -

We are trying to use this on Azure but our applications are detached from the internet using private endpoints. The HTTP request that is supposed to fetch the UIHealthReport from the endpoint is failing.

Connection attempts to local addresses (e.g. localhost, 127.0.0.1) and the machine's own IP will fail, except if another process in the same sandbox has created a listening socket on the destination port. The listening port must be > 1024 and not currently in used. Otherwise, you may get below exception.

https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#local-address-requests

To solve it, I've tried to get the HealthReport without an HTTP request. I was able to do this by injecting Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService.

The code

        private async Task<UIHealthReport> GetHealthReportAsync(HealthCheckConfiguration configuration)
        {
            var healthReport = await _healthCheckService.CheckHealthAsync();
            return UIHealthReport.CreateFrom(healthReport);
        }

That works. Unfortunately there are little extensibility points that I can hook into. Most interfaces are also internal so I cannot register other implementations for those. The extension methods that binds those together is also using internal classes.

What can I do to make this work for me? Why is this library using the HTTP endpoint and not the HealthCheckService?

Thanks!

@sungam3r
Copy link
Collaborator

sungam3r commented Apr 1, 2023

Unfortunately there are little extensibility points that I can hook into. Most interfaces are also internal so I cannot register other implementations for those. The extension methods that binds those together is also using internal classes.

Could you please be more descriptive what interfaces you expect to be public and what extensibility points to add?

@Ericvf
Copy link
Author

Ericvf commented Apr 3, 2023

For my specific problem we would benefit from IHealthCheckReportCollector being made public.

@sungam3r
Copy link
Collaborator

sungam3r commented Apr 5, 2023

@Ericvf fixed but I have no idea when it will be published, see #1593.

@sungam3r sungam3r self-assigned this Apr 5, 2023
@sungam3r sungam3r added the UI label Apr 5, 2023
@Ericvf
Copy link
Author

Ericvf commented Apr 6, 2023

Thats nice, thank you for that!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants