Add Azure Key Vault Certificates and Keys health check packages#2471
Open
Formatted wants to merge 1 commit intoXabaril:masterfrom
Open
Add Azure Key Vault Certificates and Keys health check packages#2471Formatted wants to merge 1 commit intoXabaril:masterfrom
Formatted wants to merge 1 commit intoXabaril:masterfrom
Conversation
Open
5 tasks
Author
|
@dotnet-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Adds two new health check packages following the modern split-package pattern established by
HealthChecks.Azure.KeyVault.Secrets:HealthChecks.Azure.KeyVault.Certificates— uses an injectedCertificateClientto callGetCertificateAsync(). A 404 response is treated as Healthy (vault is reachable, certificate simply absent).HealthChecks.Azure.KeyVault.Keys— uses an injectedKeyClientto callGetKeyAsync(). Same 404 handling.Both packages accept the client directly from DI (rather than a
Uri+TokenCredentialas in the olderHealthChecks.AzureKeyVaultpackage), matching the pattern of the Secrets package and enabling reuse of the configured client instance.This unblocks [microsoft/aspire#15966](microsoft/aspire#15966), which needs these packages to implement health checks for
CertificateClientandKeyClientregistrations in Aspire.Which issue(s) this PR fixes:
N/A — new packages, no existing issue.
Special notes for your reviewer:
The existing
HealthChecks.AzureKeyVaultpackage already supports certificates and keys, but uses the oldUri+TokenCredentialconstructor pattern and bundles all three resource types into one check. This PR follows the newer per-resource, DI-client pattern introduced withHealthChecks.Azure.KeyVault.Secrets.Does this PR introduce a user-facing change?:
Yes — two new NuGet packages with new
AddAzureKeyVaultCertificatesandAddAzureKeyVaultKeysextension methods onIHealthChecksBuilder.