Skip to content

Commit

Permalink
Ensure envvars are configured always, before keyvault
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Aug 22, 2024
1 parent eccd443 commit cfaf17b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Web/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public static class ConfigurationExtensions
public static IConfigurationBuilder Configure(this IConfigurationBuilder builder)
{
builder.AddUserSecrets("A85AC898-E41C-4D9D-AD9B-52ED748D9901");
builder.AddEnvironmentVariables();

// Optionally, use key vault for secrets instead of plain-text app service configuration
if (Environment.GetEnvironmentVariable("AZURE_KEYVAULT") is string kv)
builder.AddAzureKeyVault(new Uri($"https://{kv}.vault.azure.net/"), new DefaultAzureCredential());
Expand Down

0 comments on commit cfaf17b

Please sign in to comment.