Replies: 1 comment
-
Hello @rrussell0,
var app = builder.Build();
app.UseAzureAppConfiguration();
builder.AddAzureAppConfiguration("myapp-appconfig", options => {
options.Select("*", "core-service");
options.ConfigureRefresh(r =>
r.Register("RefreshKey", label: "core-service", refreshAll: true)
.SetCacheExpiration(TimeSpan.FromSeconds(5)));
});
app.MapGet("/config-refresh-test",
async (IConfiguration config, IConfigurationRefresherProvider refresherProvider) =>
{
await refresherProvider.Refreshers.First().TryRefreshAsync();
return Results.Ok(new { RefreshTest = config["RefreshTest"] ?? "(not found)" });
});
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi - I've just set up App Configuration via Aspire and hooked it into some of my services and it's working as expected, except for live-refreshing the configuration. Does anyone have any sample projects where they got this to work? For context, here's an example of how I'm doing it in my Program.cs:
Later in the Program.cs, I made a test endpoint that ideally should return the updated value when the RefreshKey is updated:
I'm new to this, so forgive me if I'm missing something very fundemental.
Beta Was this translation helpful? Give feedback.
All reactions