Closed snakefoot closed 1 year ago
Or would it just be overlapping with ${configsetting}
:
if (context.HostingEnvironment.IsProduction())
{
var builtConfig = config.Build();
var secretClient = new SecretClient(
new Uri($"https://{builtConfig["KeyVaultName"]}.vault.azure.net/"),
new DefaultAzureCredential());
var vaultOptions = new AzureKeyVaultConfigurationOptions() {
ReloadInterval = TimeSpan.FromSeconds(1000)
}
config.AddAzureKeyVault(secretClient, new KeyVaultSecretManager(), vaultOptions);
}
See also: https://docs.microsoft.com/en-us/aspnet/core/security/key-vault-configuration?view=aspnetcore-6.0 and https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets
That's interesting, I hadn't seen SecretClient
@JDetmar Would it make sense to have NLog-package that can render values extracted from Azure.Security.KeyVault.Secret ?
Could be like
${keyvaultsecret:item=mysecret}
(Similar to${configsetting}
or${appsetting}
)