Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API to reload on changes to key-values #536

Open
amerjusupovic opened this issue Mar 25, 2024 · 0 comments · May be fixed by #574
Open

Add new API to reload on changes to key-values #536

amerjusupovic opened this issue Mar 25, 2024 · 0 comments · May be fixed by #574
Assignees

Comments

@amerjusupovic
Copy link
Member

amerjusupovic commented Mar 25, 2024

Currently, the provider only has the AzureAppConfigurationRefreshOptions.Register method as a way to monitor individual key-values for refresh. By adding a new API, we can enable monitoring for all of the key-values to be loaded by the provider. Then, when a refresh is triggered, the provider will reload the configuration if any of the loaded key-values have changed in App Configuration. RegisterAll does not affect any key-values that are only specified in calls to Register.

Proposed API: RegisterAll

config.AddAzureAppConfiguration(options => {
     options.ConfigureRefresh(refresh =>
     {
         refresh.RegisterAll();
     });
});

In this example, since the provider selects all key-values with label null by default if no Select or SelectSnapshot statement is present, all of the key-values that have no label will be monitored when RegisterAll is called. If any of them have changed since the last refresh attempt, the configuration will be reloaded.

config.AddAzureAppConfiguration(options => {
     options.Select("TestApp*", "prod");
     options.ConfigureRefresh(refresh =>
     {
         refresh.RegisterAll();
     });
});

Now, changes to key-values that start with TestApp and have the label prod will trigger a configuration reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant