Reputation: 45
I was trying to add HealthChecks for AzureKeyVault to my project and added following nuget package for that :
<PackageReference Include="AspNetCore.HealthChecks.AzureKeyVault" Version="6.0.2" />
And in code, added following :
var url = "https://123456.com";
builder.Services
.AddHealthChecks()
.AddAzureKeyVault(new Uri(url), keyVaultCredential,
options => { }, "AKV", HealthStatus.Unhealthy,
tags: new string[] { "azure", "keyvault", "key-vault", "azure-keyvault" });
But issue is, its showing healthy
for each and every URL, just it should be proper URL.
and even in keyVaultCredential, if some random values are added, it showing status healthy
.
Do some one know, how can use this HealthCheck
Upvotes: 0
Views: 2845
Reputation: 21
I have the same problem, I found we need to add at lease one key vault secret in the opts to make it work. e.g. options => { options.AddSecret("SQLServerConnection--connectionString");}
Upvotes: 2
Reputation: 10831
References:
Upvotes: 1