microsoft / microsoft/FeatureManagement-Dotnet

Settings for different environment don't transform correctly

Open
#74 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.2k
Forks
129
Avg merge
1d 1h
Merged PRs (30d)
5

Description

I have a Development and Staging setup. For some business reasons, I'd like to disable certain features entirely, while enable them with predefined criteria for other environments.

For example, my appsettings.json file may have something like this

"FeatureManagement": {
    "FeatureA": {
      "EnabledFor": [
        {
          "Name": "ProductPlan",
          "Parameters": {
            "AllowedPlans": [
              "Developer",
              "Production",
              "Enterprise"
            ]
          }
        }
      ]
    }
  }

However, I'd like entirely disable this for my Staging configuration.
In my appsettings.Staging.json I would like to completely disable the feature

"FeatureManagement": {
    "FeatureA": false
  }

It appears that this is not possible. I also tried specifying different subset in the AllowedPlans, but that didn't work either - the environment specific settings file was never processed.
Other settings in it work fine.

Is this an expected behavior? Any help would be appreciated. Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the configuration described with appsettings.json and appsettings.Staging.json, focusing on the FeatureManagement section and the FeatureA shape change. Trace how the environment-specific file is processed and merged, then verify whether the staging value is honored and whether the AllowedPlans override behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.