Created
July 5, 2021 19:09
-
-
Save xximjasonxx/56634ce76d7af161adb4833ceadd6012 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureAppConfiguration((ctx, config) => | |
{ | |
var builtConfig = config.Build(); | |
var keyVaultEndpoint = builtConfig["KeyVaultEndpoint"]; | |
var secretClient = new SecretClient( | |
new Uri(keyVaultEndpoint), | |
new Azure.Identity.ManagedIdentityCredential()); | |
config.AddAzureKeyVault(secretClient, new KeyVaultSecretManager()) | |
}) | |
.ConfigureWebHostDefaults(builder => builder.UseStartup<Startup>()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment