Skip to content

Instantly share code, notes, and snippets.

@TechWatching
Created February 17, 2019 16:05
Show Gist options
  • Save TechWatching/4af8105dd58a65780c579aefab027155 to your computer and use it in GitHub Desktop.
Save TechWatching/4af8105dd58a65780c579aefab027155 to your computer and use it in GitHub Desktop.
WebHost with MSI (no client credentials)
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureAppConfiguration((builderContext, config) =>
{
var builtConfig = config.Build();
var vaultUrl = $"https://{buiItConfig["VaultName"]}.vault.azure.net/";
config.AddAzureKeyVault(vaultUrl);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment