2

I am trying to implement a health check in one of my application which is .Netcore service by refering to Readme.md file.

Here is my code in startup.cs file

services.AddHealthChecks()
                .AddAzureServiceBusQueue(connectionString: Configuration["ServiceBusSettings:ConnectionString"],
                    queueName: Configuration["ServiceBusSettings:QueueName"], tags: new[] { "readiness" })
                .AddCheck("Ping", () => HealthCheckResult.Healthy(), tags: new[] { "liveness" })
                .AddUrlGroup(new Uri($"{Configuration["ReservationApi:Url"]}/healthcheck"), name: "ReservationApi Api Healthcheck", tags: new[] { "readiness" });

Both AddCheck, AddUrlGroup are showing healthy. The problem is I am able to push messages successfully to the queue but in the health check, it is showing unhealthy for ASB queue status.

Reference screenshot enter image description here

Please help me to resolve this issue where I am doing wrong or pls suggest me is there a better to know azure service bus health status

Thanks in advance

akhil
  • 1,649
  • 3
  • 19
  • 31
  • 1
    Can you confirm if you are using the Manage access keys for authenticating the service bus resource as I can see someone reporting that it needs manager access : https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/727 Hope this helps you to resolve the issue. – MayankBargali Mar 22 '21 at 06:20
  • thanks, @MayankBargali-MSFT, I just came to know that they are some restrictions in using this library in my company VPN network for knowing the health status of azure resources. – akhil Mar 24 '21 at 05:13

1 Answers1

2

For others, if someone else is facing the issue. Then please verify the below actions

  • Verify whether you are using the Manage access keys for authenticating the service bus resource.
  • Test your code in a different network to verify if there an issue with the network/restriction.
  • You can use any of the debugging tools to capture the traffic to verify whether there are any requests initiate from your client machine and what was the response.
MayankBargali
  • 712
  • 5
  • 8