Share via


AspireKeyVaultExtensions.AddAzureKeyVaultSecrets Method

Definition

Adds the Azure KeyVault secrets to be configuration values in the configurationManager.

public static void AddAzureKeyVaultSecrets (this Microsoft.Extensions.Configuration.IConfigurationManager configurationManager, string connectionName, Action<Aspire.Azure.Security.KeyVault.AzureSecurityKeyVaultSettings>? configureSettings = default, Action<Azure.Security.KeyVault.Secrets.SecretClientOptions>? configureClientOptions = default, Azure.Extensions.AspNetCore.Configuration.Secrets.AzureKeyVaultConfigurationOptions? options = default);
static member AddAzureKeyVaultSecrets : Microsoft.Extensions.Configuration.IConfigurationManager * string * Action<Aspire.Azure.Security.KeyVault.AzureSecurityKeyVaultSettings> * Action<Azure.Security.KeyVault.Secrets.SecretClientOptions> * Azure.Extensions.AspNetCore.Configuration.Secrets.AzureKeyVaultConfigurationOptions -> unit
<Extension()>
Public Sub AddAzureKeyVaultSecrets (configurationManager As IConfigurationManager, connectionName As String, Optional configureSettings As Action(Of AzureSecurityKeyVaultSettings) = Nothing, Optional configureClientOptions As Action(Of SecretClientOptions) = Nothing, Optional options As AzureKeyVaultConfigurationOptions = Nothing)

Parameters

configurationManager
IConfigurationManager

The IConfigurationManager to add the secrets to.

connectionName
String

A name used to retrieve the connection string from the ConnectionStrings configuration section.

configureSettings
Action<AzureSecurityKeyVaultSettings>

An optional method that can be used for customizing the AzureSecurityKeyVaultSettings. It's invoked after the settings are read from the configuration.

configureClientOptions
Action<SecretClientOptions>

An optional method that can be used for customizing the SecretClientOptions.

options
AzureKeyVaultConfigurationOptions

An optional AzureKeyVaultConfigurationOptions instance to configure the behavior of the configuration provider.

Applies to