diff --git a/src/HealthChecks.Azure.KeyVault.Secrets/AzureKeyVaultSecretsHealthCheck.cs b/src/HealthChecks.Azure.KeyVault.Secrets/AzureKeyVaultSecretsHealthCheck.cs index 9b3d9164ee..4e9e0fe83f 100644 --- a/src/HealthChecks.Azure.KeyVault.Secrets/AzureKeyVaultSecretsHealthCheck.cs +++ b/src/HealthChecks.Azure.KeyVault.Secrets/AzureKeyVaultSecretsHealthCheck.cs @@ -41,7 +41,7 @@ public async Task CheckHealthAsync(HealthCheckContext context try { - await _secretClient.GetSecretAsync(name: secretName, cancellationToken: cancellationToken).ConfigureAwait(false); + _ = await _secretClient.GetSecretAsync(name: secretName, cancellationToken: cancellationToken).ConfigureAwait(false); return new HealthCheckResult(HealthStatus.Healthy); } diff --git a/src/HealthChecks.AzureKeyVault/AzureKeyVaultHealthCheck.cs b/src/HealthChecks.AzureKeyVault/AzureKeyVaultHealthCheck.cs index 33739fb39c..70197d3f2a 100644 --- a/src/HealthChecks.AzureKeyVault/AzureKeyVaultHealthCheck.cs +++ b/src/HealthChecks.AzureKeyVault/AzureKeyVaultHealthCheck.cs @@ -31,7 +31,9 @@ public async Task CheckHealthAsync(HealthCheckContext context { // https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/785 if (_options._keys.Count == 0 && _options.Certificates.Count == 0 && _options._secrets.Count == 0) + { return HealthCheckResult.Unhealthy("No keys, certificates or secrets configured."); + } foreach (string secret in _options.Secrets) {