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
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,8 @@ The feature management library supports appsettings.json as a feature flag sourc
91
91
92
92
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.
93
93
94
+
The detailed schema of the `FeatureManagement` section can be found [here](./schemas/FeatureManagement.Dotnet.v1.0.0.schema.json).
95
+
94
96
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
95
97
96
98
#### On/Off Declaration
@@ -121,7 +123,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil
121
123
122
124
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.
123
125
124
-
```
126
+
```JavaScript
125
127
"FeatureW": {
126
128
"RequirementType":"All",
127
129
"EnabledFor": [
@@ -144,6 +146,36 @@ A `RequirementType` of `All` changes the traversal. First, if there are no filte
144
146
145
147
In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning all of its filters must evaluate to true for the feature to be enabled. In this case, the feature will be enabled for 50% of users during the specified time window.
146
148
149
+
#### Microsoft Feature Management Schema
150
+
151
+
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.
152
+
153
+
```JavaScript
154
+
{
155
+
"feature_management": {
156
+
"feature_flags": [
157
+
{
158
+
"id":"FeatureT",
159
+
"enabled":true,
160
+
"conditions": {
161
+
"client_filters": [
162
+
{
163
+
"name":"Microsoft.TimeWindow",
164
+
"parameters": {
165
+
"Start":"Mon, 01 May 2023 13:59:59 GMT",
166
+
"End":"Sat, 01 July 2023 00:00:00 GMT"
167
+
}
168
+
}
169
+
]
170
+
}
171
+
}
172
+
]
173
+
}
174
+
}
175
+
```
176
+
177
+
**Note:** If the `feature_management` section can be found in the configuration, the `FeatureManagement` section will be ignored.
178
+
147
179
## Consumption
148
180
149
181
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