diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index d721d00cf..5fdc5259a 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -21,6 +21,8 @@ + + @@ -29,8 +31,7 @@ - - + diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index 058735a07..3e623cdac 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -5,6 +5,7 @@ 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; @@ -89,9 +90,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"),new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 71558fc6e..e49538fdb 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -48,14 +48,15 @@ + + - - + diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 1507b1d8e..5f8bdea87 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -14,6 +14,7 @@ using Serilog; using System; using System.IO; using System.Net; +using Azure.Identity; var configuration = GetConfiguration(); @@ -108,10 +109,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { - builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + builder.AddAzureKeyVault(new Uri(""), new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 7184410d2..55ad09a2d 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -19,6 +19,8 @@ + + @@ -38,7 +40,6 @@ - diff --git a/src/Services/Identity/Identity.API/Program.cs b/src/Services/Identity/Identity.API/Program.cs index 909680621..226fdbfd0 100644 --- a/src/Services/Identity/Identity.API/Program.cs +++ b/src/Services/Identity/Identity.API/Program.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Options; using Serilog; using System; using System.IO; +using Azure.Identity; string Namespace = typeof(Startup).Namespace; string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); @@ -93,10 +94,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { - builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + builder.AddAzureKeyVault(new Uri(""), new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index ef71dde81..daa84fe0f 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -42,6 +42,8 @@ + + @@ -54,8 +56,7 @@ - - + diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index 0a42cbba1..79114df8a 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -13,6 +13,7 @@ using Serilog; using System; using System.IO; using System.Net; +using Azure.Identity; var configuration = GetConfiguration(); @@ -100,10 +101,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { - builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + builder.AddAzureKeyVault(new Uri(""), new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index e438f4e66..dbd64e9bf 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -14,11 +14,12 @@ + + - diff --git a/src/Services/Payment/Payment.API/Program.cs b/src/Services/Payment/Payment.API/Program.cs index 1e5dd1922..a0abf47b2 100644 --- a/src/Services/Payment/Payment.API/Program.cs +++ b/src/Services/Payment/Payment.API/Program.cs @@ -7,6 +7,7 @@ using Payment.API; using Serilog; using System; using System.IO; +using Azure.Identity; var configuration = GetConfiguration(); @@ -69,10 +70,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { - builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + builder.AddAzureKeyVault(new Uri(""), new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Web/WebStatus/Program.cs b/src/Web/WebStatus/Program.cs index a06f0b142..1df153d72 100644 --- a/src/Web/WebStatus/Program.cs +++ b/src/Web/WebStatus/Program.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Reflection; using WebStatus; +using Azure.Identity; var configuration = GetConfiguration(); @@ -70,10 +71,7 @@ IConfiguration GetConfiguration() if (config.GetValue("UseVault", false)) { - builder.AddAzureKeyVault( - $"https://{config["Vault:Name"]}.vault.azure.net/", - config["Vault:ClientId"], - config["Vault:ClientSecret"]); + builder.AddAzureKeyVault(new Uri(""), new DefaultAzureCredential()); } return builder.Build(); diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index c3f22905b..e57e49252 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -12,11 +12,12 @@ + + -