|
|
@ -5,10 +5,12 @@ using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core; |
|
|
|
using Microsoft.eShopOnContainers.Services.Basket.API; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Azure.Identity; |
|
|
|
using Serilog; |
|
|
|
using System; |
|
|
|
using System.IO; |
|
|
|
using System.Net; |
|
|
|
using Azure.Core; |
|
|
|
|
|
|
|
var configuration = GetConfiguration(); |
|
|
|
|
|
|
@ -88,10 +90,11 @@ IConfiguration GetConfiguration() |
|
|
|
|
|
|
|
if (config.GetValue<bool>("UseVault", false)) |
|
|
|
{ |
|
|
|
builder.AddAzureKeyVault( |
|
|
|
$"https://{config["Vault:Name"]}.vault.azure.net/", |
|
|
|
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(); |
|
|
@ -109,4 +112,4 @@ public class Program |
|
|
|
|
|
|
|
public static string Namespace = typeof(Startup).Namespace; |
|
|
|
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); |
|
|
|
} |
|
|
|
} |