Using IFeatureManager only has two methods that only allow to get a feature per request. Is there a way to get all the features and their values (true or false)?
2 Answers
@Elias Rodriguez, you can call FeatureManager.GetFeatureNamesAsync()
to get the full list of feature flags that are available. Then you can call FeatureManager.IsEnabledAsync()
on each of them to get their true/false status.

- 1,213
- 8
- 10
-
So, if I have 40 features I would be doing 40 calls right? – Elias Rodriguez May 03 '21 at 17:11
-
1You do one call to `GetFeatureNamesAsync` to get all feature flag names and do 40 calls to `IsEnabledAsync` to get their true/false status. Note that the feature flag state is evaluated locally to your app when calling `IsEnabledAsync`. There are no network calls to App Configuration during that process. – Zhenlan Wang May 03 '21 at 19:15
Azure AppConfiguration stores all of its data in the Configuration subsystem (Microsoft.Extensions.Configuration). More on this topic here.
You can peek inside all of the configuration by registering IConfigurationRoot
into DI and injecting it in a service and calling its GetDebugView()
*. This method was added in .NET Core 3.0, so if you are in an older version you will not have it. You can always just loop over the IConfigurationRoot
and take a look at its content.
Once you have identified the key
that you are interested in, you can just use configurationRoot[Key]
to extract the raw data from Azure AppConfiguration.

- 6,152
- 2
- 30
- 31
-
If I understood correctly, this only gets them all once at the startup of the application and never again until the app is restarted. Is there a way to get all the updated configurations from Azure App Configuration every time it is needed? – Elias Rodriguez May 01 '21 at 00:26
-
[Based on the documentation](https://github.com/microsoft/FeatureManagement-Dotnet#caching) they should get refreshed if you do a `IConfigurationRoot.Reload()` – epignosisx May 02 '21 at 00:49