|
|
@ -12,6 +12,7 @@ using Serilog; |
|
|
|
using System; |
|
|
|
using System.IO; |
|
|
|
using Azure.Identity; |
|
|
|
using Azure.Core; |
|
|
|
|
|
|
|
string Namespace = typeof(Startup).Namespace; |
|
|
|
string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); |
|
|
@ -94,7 +95,11 @@ IConfiguration GetConfiguration() |
|
|
|
|
|
|
|
if (config.GetValue<bool>("UseVault", false)) |
|
|
|
{ |
|
|
|
builder.AddAzureKeyVault(new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"), new DefaultAzureCredential()); |
|
|
|
TokenCredential credential = new ClientSecretCredential( |
|
|
|
config["Vault:TenantId"], |
|
|
|
config["Vault:ClientId"], |
|
|
|
config["Vault:ClientSecret"]); |
|
|
|
builder.AddAzureKeyVault(new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"), credential); |
|
|
|
} |
|
|
|
|
|
|
|
return builder.Build(); |