Last active
July 3, 2022 21:18
-
-
Save MirzaMerdovic/3feb8fdb4d737e60f04b0f1086fb0b59 to your computer and use it in GitHub Desktop.
Snippet for: https://medium.com/p/de398e009553
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
var builder = WebApplication.CreateBuilder(args); | |
builder.Configuration | |
.AddAzureAppConfiguration(options => | |
{ | |
var connectionString = Environment.GetEnvironmentVariable("AppConfiguration__ConnectionString"); | |
options | |
.Connect(connectionString) | |
.Select("Appc:*", "configs") | |
.ConfigureKeyVault(kv => | |
{ | |
kv.SetCredential(new DefaultAzureCredential()); | |
}) | |
.ConfigureRefresh(x => | |
{ | |
x.Register("Appc:Foo", "configs", true); | |
x.Register("Appc:FooSecret", "configs", true); | |
x.SetCacheExpiration(TimeSpan.FromDays(1)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment