You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-34Lines changed: 2 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,8 +96,6 @@ The feature management library supports appsettings.json as a feature flag sourc
96
96
97
97
The `FeatureManagement` section of the json document is used by convention to load feature flag settings. In the section above, we see that we have provided three different features. Features define their feature filters using the `EnabledFor` property. In the feature filters for `FeatureT` we see `AlwaysOn`. This feature filter is built-in and if specified will always enable the feature. The `AlwaysOn` feature filter does not require any configuration, so it only has the `Name` property. `FeatureU` has no filters in its `EnabledFor` property and thus will never be enabled. Any functionality that relies on this feature being enabled will not be accessible as long as the feature filters remain empty. However, as soon as a feature filter is added that enables the feature it can begin working. `FeatureV` specifies a feature filter named `TimeWindow`. This is an example of a configurable feature filter. We can see in the example that the filter has a `Parameters` property. This is used to configure the filter. In this case, the start and end times for the feature to be active are configured.
98
98
99
-
The detailed schema of the `FeatureManagement` section can be found [here](./schemas/FeatureManagement.Dotnet.v1.0.0.schema.json).
100
-
101
99
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
102
100
103
101
#### On/Off Declaration
@@ -128,7 +126,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil
128
126
129
127
A `RequirementType` of `All` changes the traversal. First, if there are no filters, the feature will be disabled. Then, the feature-filters are traversed until one of the filters decides that the feature should be disabled. If no filter indicates that the feature should be disabled, then it will be considered enabled.
130
128
131
-
```JavaScript
129
+
```
132
130
"FeatureW": {
133
131
"RequirementType": "All",
134
132
"EnabledFor": [
@@ -156,7 +154,7 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning
156
154
`Status` is an optional property of a feature flag that controls how a flag's enabled state is evaluated. By default, the status of a flag is `Conditional`, meaning that feature filters should be evaluated to determine if the flag is enabled. If the `Status` of a flag is set to `Disabled` then feature filters are not evaluated and the flag is always considered to be disabled.
157
155
158
156
159
-
```JavaScript
157
+
```
160
158
"FeatureX": {
161
159
"Status": "Disabled",
162
160
"EnabledFor": [
@@ -169,36 +167,6 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning
169
167
170
168
In this example, even though the `AlwaysOn` filter would normally always make the feature enabled, the `Status` property is set to `Disabled`, so this feature will always be disabled.
171
169
172
-
#### Microsoft Feature Management Schema
173
-
174
-
The feature management library also supports the usage of the [`Microsoft Feature Management schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureManagement.v1.0.0.schema.json) to declare feature flags. This schema is language agnostic in origin and is supported by all Microsoft feature management libraries.
175
-
176
-
```JavaScript
177
-
{
178
-
"feature_management": {
179
-
"feature_flags": [
180
-
{
181
-
"id":"FeatureT",
182
-
"enabled":true,
183
-
"conditions": {
184
-
"client_filters": [
185
-
{
186
-
"name":"Microsoft.TimeWindow",
187
-
"parameters": {
188
-
"Start":"Mon, 01 May 2023 13:59:59 GMT",
189
-
"End":"Sat, 01 July 2023 00:00:00 GMT"
190
-
}
191
-
}
192
-
]
193
-
}
194
-
}
195
-
]
196
-
}
197
-
}
198
-
```
199
-
200
-
**Note:** If the `feature_management` section can be found in the configuration, the `FeatureManagement` section will be ignored.
201
-
202
170
## Consumption
203
171
204
172
The basic form of feature management is checking if a feature flag is enabled and then performing actions based on the result. This is done through the `IFeatureManager`'s `IsEnabledAsync` method.
0 commit comments