Skip to content

IFeatureManager.GetFeatureNamesAsync returning all configuration keys #55

Closed

Description

@satuday

I dont have a 'FeatureManagement' section in my appsettings.json, but when I call GetFeatureNamesAsync, it is returning key in IConfiguration.

I'd also try adding 'FeatureManagement' section without any feature set, but the result was the same.

the following are some of the names return from GetFeatureNamesAsync()

"AllowedHosts"
"ALLUSERSPROFILE"
"APPDATA"
"applicationName"
"APP_POOL_CONFIG"
"APP_POOL_ID"
"ASPNETCORE_ENVIRONMENT"
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"
"ASPNETCORE_IIS_HTTPAUTH"
"ASPNETCORE_IIS_PHYSICAL_PATH"

Activity

  1. jimmyca15 commented on Apr 6, 2020

    @jimmyca15
    Member

    Hello Felix Zhang (@satuday),

    When no FeatureManagement section is provided the library treats the root of the registered IConfiguration as the featuremanagement section. This is detailed in the readme.

    Using a FeatureManagement section would be the proper method to prevent all configuration keys from being returned from this API. Otherwise, there is no way to distinguish a non-feature configuration key vs a feature configuration key.

  2. jimmyca15 commented on Apr 16, 2020

    @jimmyca15
    Member

    Closing by design. To avoid this please use a "FeatureManagement" section in the application's configuration or pass in an IConfiguration instance which does not contain non-features.

  3. JakeRoper4 commented on Aug 22, 2020

    @JakeRoper4

    Felix Zhang (@satuday) Hello, I've recently just come across this same issue whilst testing integration with Azure App Configuration and its feature management functionality. Did you manage to get around this using the above steps? Or did you find a different approach that perhaps you could share?

  4. satuday commented on Aug 22, 2020

    @satuday
    Author

    Unfortunately I did not. I stopped using the feature manager and switched to launchdarkly.

  5. jgn-epp commented on Jan 25, 2022

    @jgn-epp

    Super confusing behavior IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions