-
Notifications
You must be signed in to change notification settings - Fork 112
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
Need ability to get all features #29
Comments
in Startup, can do like using System.Linq;
//...
private IConfiguration AppSettings;
//...
//this gets the list of keys under the "FeatureManagement" object value,
//assuming following their convention
AppSettings.GetSection("FeatureManagement").GetChildren().Select((f) => f.Key); getting list of enabled features may be more tricky if you are using the more advanced features. if you are only using the |
I already had something similar in place actually. It just seems like something that would be convenient for FeatureManager to provide and potentially more useful than just asking for each feature one by one if you have a long list of features. Something like FeatureManager.GetAllFeatures() and FeatureManager.GetEnabledFeatures() would reduce the number of round trips on a higher latency device with questionable network quality. |
@millicandavid the code snippet @mariotee suggested is searching configuration from the memory. It won't cause any network calls. Just for my learning, @millicandavid, do you mind to elaborate on what are the scenarios you will want those APIs? |
@zhenlan I understand that iterating the list of keys does not cause any network traffic, and I suppose I'm making an assumption that may not necessarily be true, but I thought my calls to _featureManager.IsEnabled(key) which are inside that iteration would be making calls to some feature management API. I suppose I should verify if that is the case or not. So if FeatureManager is only using in memory IConfiguration to resolve IsEnabled() then that's not an issue. We front end devs were asking to just get a list of all enabled features with one call and I have this workaround so it's not a big deal. I just thought providing this within FeatureManager would make for a cleaner solution and it seemed to be within its domain. For my solution I suppose I don't need FeatureManager at all and can just use IConfiguration for everything. |
@millicandavid thanks for sharing. The |
@zhenlan the ask here is a bit simpler I believe. We can expose an api Exposing |
Yes, a helper to get the list of all features makes sense. Maybe a property |
If GetEnabledFeatures() could be IEnumerable because you expect them all to be enabled. However, GetFeatures() would have to be something like IEnumerable<KeyValuePair<string, bool>> right? And yes, just having GetFeatures() would be enough if you had the feature and bool value. |
The proposal is to not do any evaluation of the feature state with the Proposed Snippet
|
Any idea when you expect to deliver this in a package? |
@millicandavid I would estimate early March. At the moment the Azure App Configuration team is buckled down to prepare for the GA of the service. There are a few open issues that we will tackle/fix all at once and this will be included in. |
I need the ability to get a list of all features and potentially get only enabled features as well.
The text was updated successfully, but these errors were encountered: