replace credential
This commit is contained in:
parent
0421be2221
commit
8ca2e75bed
@ -10,6 +10,7 @@ using Serilog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Azure.Core;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
@ -89,7 +90,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();
|
||||
|
@ -15,6 +15,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Azure.Identity;
|
||||
using Azure.Core;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
@ -109,7 +110,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();
|
||||
|
@ -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();
|
||||
|
@ -14,6 +14,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Azure.Identity;
|
||||
using Azure.Core;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
@ -101,7 +102,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();
|
||||
|
@ -8,7 +8,7 @@ using Serilog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Azure.Identity;
|
||||
|
||||
using Azure.Core;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
@ -70,7 +70,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();
|
||||
|
@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using WebStatus;
|
||||
using Azure.Identity;
|
||||
using Azure.Core;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
@ -71,7 +72,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user