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: articles/azure-app-configuration/feature-management-python-reference.md
+6-12Lines changed: 6 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Here are some of the benefits of using Python feature management library:
37
37
* Low barrier-to-entry
38
38
* Supports JSON feature flag setup
39
39
* Feature Flag lifetime management
40
-
* Configuration values can change in real-time; feature flags can be consistent across the entire request
40
+
* Configuration values can change in real-time; feature flags can be consistent across the entire requestf
41
41
* Simple to Complex Scenarios Covered
42
42
* Toggle on/off features through declarative configuration file
43
43
* Dynamically evaluate state of feature based on call to server
@@ -48,18 +48,16 @@ Here are some of the benefits of using Python feature management library:
48
48
Feature flags are composed of two parts, a name and a list of feature-filters that are used to turn on the feature.
49
49
50
50
### Feature Filters
51
-
Feature filters define a scenario for when a feature should be enabled. When a feature is evaluated for whether it is on or off, its list of feature filters is traversed until one of the filters decides the feature should be enabled. At this point, the feature is considered enabled and traversal through the feature filters stops. If no feature filter indicates that the feature should be enabled, it's considered disabled.
51
+
Feature filters define a scenario for when a feature should be enabled. When a feature is evaluated for whether it is on or off, its list of feature filters is traversed until one of the filters decides the feature should be enabled. At this point, the feature is considered enabled and traversal through the feature filters stops. If no feature filter indicates that the feature should be enabled, it will be considered disabled.
52
52
53
-
As an example, a Microsoft Edge browser feature filter could be designed. This feature filter would activate any features it's attached to as long as an HTTP request is coming from Microsoft Edge.
53
+
As an example, a Microsoft Edge browser feature filter could be designed. This feature filter would activate any features attached to it, as long as an HTTP request is coming from Microsoft Edge.
54
54
55
55
### Feature Flag Configuration
56
56
57
57
A Python dictionary is used to define feature flags. The dictionary is composed of feature names as keys and feature flag objects as values. The feature flag object is a dictionary that contains an `EnabledFor` key. The `EnabledFor` key is a list of feature filters that are used to determine if the feature should be enabled
58
58
59
59
### Feature Flag Declaration
60
60
61
-
:::zone target="docs" pivot="stable-version"
62
-
63
61
The feature management library supports json as a feature flag source. Below we have an example of the format used to set up feature flags in a json file.
64
62
65
63
```json
@@ -162,10 +160,6 @@ A `requirement_type` of `All` changes the traversal. First, if there are no filt
162
160
163
161
In the above example, `FeatureW` specifies a `requirement_type` of `All`, meaning all of its filters must evaluate to true for the feature to be enabled. In this case, the feature is enabled for 50% of users during the specified time window.
164
162
165
-
### Python Feature Management schema
166
-
167
-
In previous versions, the primary schema for the feature management library was the [`.NET feature management schema`](https://github.com/microsoft/FeatureManagement/blob/main/Schema/FeatureManagement.v2.0.0.schema.json). Starting from v2.0.0b1, new features including variants and telemetry won't be supported for the .NET feature management schema.
168
-
169
163
## Consumption
170
164
171
165
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 `FeatureManager`'s `is_enabled` method.
@@ -214,7 +208,6 @@ Each of the built-in feature filters has its own parameters. Here's the list of
214
208
This filter provides the capability to enable a feature based on a time window. If only `End` is specified, the feature is considered on until that time. If only `Start` is specified, the feature is considered on at all points after that time.
215
209
216
210
```json
217
-
218
211
"client_filters": [
219
212
{
220
213
"name": "Microsoft.TimeWindow",
@@ -223,8 +216,7 @@ This filter provides the capability to enable a feature based on a time window.
223
216
"End": "Mon, 01 Jul 2019 00:00:00 GMT"
224
217
}
225
218
}
226
-
]
227
-
219
+
]
228
220
```
229
221
230
222
### Microsoft.Targeting
@@ -609,6 +601,8 @@ When a feature flag is evaluated and telemetry is enabled, the feature manager w
609
601
|`Variant`| The assigned variant. |
610
602
|`VariantAssignmentReason`| The reason why the variant is assigned. |
611
603
604
+
:::zone-end
605
+
612
606
## Next steps
613
607
614
608
To learn how to use feature flags in your applications, continue to the following quickstarts.
0 commit comments