0

I'm using the healthCheck to verify the state of the services but I have an error when this service is in IIS.

In ConfigureServices:

services.AddHealthChecksUI(s =>
{
   s.AddHealthCheckEndpoint("Validations", "/CheckPoints");
}).AddInMemoryStorage();  

services.AddHealthChecks();

In Configure

  builder.MapHealthChecksUI(setupOptions: setup =>
  {
      setup.UIPath = "/CheckPointsUI";
  });
  builder.MapHealthChecks("/CheckPoints", new HealthCheckOptions()
  {
      Predicate = _ => true,
      ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
  });
  builder.MapHealthChecks("/Status");

When I run the service in localhost all works good but the same code in IIS pool I have the next error:

An invalid request URI was provided. The request URI must either be an absolute URI or BaseAdress must be set

I don't know why it behaves differently.

jps
  • 20,041
  • 15
  • 75
  • 79
Kirtash666
  • 11
  • 2
  • It is difficult to reproduce your problem, I suggest you open a case via: https://support.microsoft.com. – samwu Oct 20 '21 at 09:45
  • I detected the possible error, is in this line: `s.AddHealthCheckEndpoint("Validations", "/CheckPoints");` If I add the absoluteUri in appsettings it works. In this moment only I have one variable, I don't know if I should add more variables there. – Kirtash666 Oct 28 '21 at 09:58

0 Answers0