如何为AzureKeyvault健康状况添加HealthChecks

发布于 2025-02-03 05:56:01 字数 702 浏览 5 评论 0原文

我试图将AzureKeykevault的HealthChecks添加到我的项目中,并按照Nuget软件包添加:

<PackageReference Include="AspNetCore.HealthChecks.AzureKeyVault" Version="6.0.2" />

在代码中添加以下内容:

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" });

但是问题是,它显示了每个URL的Healthy适当的URL。 甚至在keyVaultCredential中,如果添加了一些随机值,它也会显示状态healthy

做一个人知道,如何使用此healthcheck

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的那么颓废 2025-02-10 05:56:01

我遇到了同样的问题,我发现我们需要在选项中添加一个租用一个钥匙保险库秘密,以使其正常工作。例如options =&gt; {options.addsecret(“ sqlServerConnection--connectionstring”);}

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");}

一花一树开 2025-02-10 05:56:01
  • 请检查是否有任何了解健康的限制
    Azure资源的状态或在您的中使用此库的状态
    公司VPN网络。
  • 在不同的网络中尝试相同的方法以检查原因是否为网络
    发出或VPN
  • 尝试调试工具以捕获流量以验证和查看响应。

参考:

  1. azurekeykeyveault health Chealt始终返回“健康”
    (github.com)
  2. nofollow noreferrer“> aspnetcore.diarostics.diarostics.healthealthchecks
  • Please check if there are any restrictions in knowing the health
    status of azure resources or with the use of this library in your
    company VPN network .
  • Try the same in different network to check if the cause is network
    issue or VPN
  • Try with debugging tools to capture the traffic to verify and see response.

References:

  1. AzureKeyVault health check always returns "healthy"
    (github.com)
  2. AspNetCore.Diagnostics.HealthChecks
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文