Table of Contents

Class AzureKeyVaultCredentialStore

Namespace
JD.AI.Credentials.Azure
Assembly
JD.AI.Credentials.Azure.dll

An ICredentialStore backed by Azure Key Vault. Each credential key maps to an Azure Key Vault secret name with slashes replaced by hyphens.

public sealed class AzureKeyVaultCredentialStore : ICredentialStore
Inheritance
AzureKeyVaultCredentialStore
Implements
Inherited Members

Constructors

AzureKeyVaultCredentialStore(SecretClient, ILogger<AzureKeyVaultCredentialStore>)

Initializes the store with a pre-configured SecretClient.

public AzureKeyVaultCredentialStore(SecretClient client, ILogger<AzureKeyVaultCredentialStore> logger)

Parameters

client SecretClient
logger ILogger<AzureKeyVaultCredentialStore>

Properties

IsAvailable

Whether this store is available on the current platform.

public bool IsAvailable { get; }

Property Value

bool

StoreName

Human-readable name of the backing store.

public string StoreName { get; }

Property Value

string

Methods

GetAsync(string, CancellationToken)

Gets a stored credential value.

public Task<string?> GetAsync(string key, CancellationToken ct = default)

Parameters

key string
ct CancellationToken

Returns

Task<string>

ListKeysAsync(string, CancellationToken)

Lists all keys matching a prefix.

public Task<IReadOnlyList<string>> ListKeysAsync(string prefix, CancellationToken ct = default)

Parameters

prefix string
ct CancellationToken

Returns

Task<IReadOnlyList<string>>

RemoveAsync(string, CancellationToken)

Removes a stored credential.

public Task RemoveAsync(string key, CancellationToken ct = default)

Parameters

key string
ct CancellationToken

Returns

Task

SetAsync(string, string, CancellationToken)

Stores a credential value.

public Task SetAsync(string key, string value, CancellationToken ct = default)

Parameters

key string
value string
ct CancellationToken

Returns

Task