I am using nuget Microsoft.Extensions.Configuration.AzureKeyVault
and I am using below code for asp.net core 3.1 in Program.cs
,
I am doing custom certificate authentication for azure keyVault. Also using custom secret management.
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((context, config) =>
{
config.AddAzureKeyVault(new AzureKeyVaultConfigurationOptions
{
Vault = "key vault url",
ReloadInterval = TimeSpan.FromSeconds(15),
//authenticate with custom certificate
Client = new KeyVaultClient(CustomCertificateAuthenticationCallback),
Manager = new CustomKeyVaultSecretManager()
});
}
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
The package Microsoft.Extensions.Configuration.AzureKeyVault
is deprecated and I have uninstalled this package and installed the updated one Azure.Extensions.AspNetCore.Configuration.Secrets
. After switching to this package I am NOT able to figure our how to use custom
validation and how to pass keyvault url