Table of Contents

Interface IKeyVaultService

Namespace
arolariu.Backend.Common.Services.KeyVault
Assembly
arolariu.Backend.Common.dll

Interface that handles the Azure Key Vault integration. This interface is used by the KeyVaultService class. The KeyVaultService class is used to fetch secrets from Azure Key Vault. This interface offers both synchronous and asynchronous methods for fetching secrets from Azure Key Vault.

public interface IKeyVaultService

Methods

TryGetSecret(string)

Fetches a Key Vault secret by name synchronously. When using this method, the thread will be blocked until the secret is fetched. For asynchronous fetching, use the TryGetSecretAsync(string) method.

string TryGetSecret(string secretName)

Parameters

secretName string

The name of the secret to fetch from Azure Key Vault.

Returns

string

The value of the secret.

TryGetSecretAsync(string)

Fetches a Key Vault secret by name asynchronously. When using this method, the thread will not be blocked until the secret is fetched. For synchronous fetching, use the TryGetSecret(string) method.

Task<string> TryGetSecretAsync(string secretName)

Parameters

secretName string

The name of the secret to fetch from Azure Key Vault.

Returns

Task<string>

A task representing the asynchronous operation. The result of the task is the value of the secret.