Skip to main content
Version: v0.4.0

Replace configuration tokens with ISecretProvider

When building your IConfiguration, you can use the extension .AddAzureKeyVault to pass in your ISecretProvider instead of using the built-in Azure Key Vault provider.


This feature requires to install our NuGet package

PM > Install-Package Arcus.Security.Providers.AzureKeyVault


Example how the configuration builder is used inside a web application:

var vaultAuthenticator = new ManagedServiceIdentityAuthenticator();var vaultConfiguration = new KeyVaultConfiguration(keyVaultUri);var yourSecretProvider = new KeyVaultSecretProvider(vaultAuthenticator, vaultConfiguration);
var config = new ConfigurationBuilder()    .AddAzureKeyVault(yourSecretProvider)    .Build();
var host = new WebHostBuilder()    .UseConfiguration(config)    .UseKestrel()    .UseStartup<Startup>();