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
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ 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 will be 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 considered disabled.
52
52
53
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
@@ -184,7 +184,7 @@ The following snippet demonstrates how to add a customized feature filter `MyCri
Feature filters are registered by providing when creating `FeatureManager` with `feature_filters`. If a custom feature filter needs any context they can be passed in when calling `is_enabled` using `kwargs`.
187
+
Feature filters are registered by providing when creating `FeatureManager` with `feature_filters`. If a custom feature filter needs any context, they can be passed in when calling `is_enabled` using `kwargs`.
188
188
189
189
### Filter Alias Attribute
190
190
@@ -194,7 +194,7 @@ The identifier for the feature filter can be overridden by using the `@FeatureFi
194
194
195
195
### Missing Feature Filters
196
196
197
-
If a feature is configured to be enabled for a specific feature filter and that feature filter isn't registered, an `ValueError` exception is raised when the feature is evaluated.
197
+
If a feature, configured to be enabled, for a specific feature filter and that feature filter isn't registered, an `ValueError` exception is raised when the feature is evaluated.
198
198
199
199
## Built-In Feature Filters
200
200
@@ -317,7 +317,7 @@ In the above example, the feature is enabled for users named `Jeff` and `Alicia`
317
317
318
318
## Variants
319
319
320
-
When new features are added to an application, there may come a time when a feature has multiple different proposed design options. A common solution for deciding on a design is some form of A/B testing, which involves providing a different version of the feature to different segments of the user base and choosing a version based on user interaction. In this library, this functionality is enabled by representing different configurations of a feature with variants.
320
+
When new features are added to an application, there may come a time when a feature has multiple different proposed design options. A common solution for deciding on a design is some form of A/B testing. A/B testing involves providing a different version of the feature to different segments of the user base and choosing a version based on user interaction. In this library, this functionality is enabled by representing different configurations of a feature with variants.
321
321
322
322
Variants enable a feature flag to become more than a simple on/off flag. A variant represents a value of a feature flag that can be a string, a number, a boolean, or even a configuration object. A feature flag that declares variants should define under what circumstances each variant should be used, which is covered in greater detail in the [Allocating Variants](#allocating-variants) section.
323
323
@@ -361,7 +361,7 @@ The variant returned is dependent on the user currently being evaluated, and tha
361
361
362
362
### Variant Feature Flag Declaration
363
363
364
-
Compared to normal feature flags, variant feature flags have two additional properties: `variants`and`allocation`. The `variants`propertyis an array that contains the variants defined for this feature. The `allocation`property defines how these variants should be allocated for the feature. Just like declaring normal feature flags, you can set up variant feature flags in a json file. Here's an example of a variant feature flag.
364
+
Compared to normal feature flags, variant feature flags have two more properties: `variants`and`allocation`. The `variants`propertyis an array that contains the variants defined for this feature. The `allocation`property defines how these variants should be allocated for the feature. Just like declaring normal feature flags, you can set up variant feature flags in a json file. Here's an example of a variant feature flag.
365
365
366
366
```json
367
367
{
@@ -397,7 +397,7 @@ Compared to normal feature flags, variant feature flags have two additional prop
397
397
398
398
#### Defining Variants
399
399
400
-
Each variant has two properties: a name and a configuration. The name is used to refer to a specific variant, and the configuration is the value of that variant. The configuration can be set using `configuration_value`property. `configuration_value`is an inline configuration that can be a string, number, boolean, or configuration object. If `configuration_value` isn't specified, the returned variant's `Configuration`propertywill be null.
400
+
Each variant has two properties: a name and a configuration. The name is used to refer to a specific variant, and the configuration is the value of that variant. The configuration can be set using `configuration_value`property. `configuration_value`is an inline configuration that can be a string, number, boolean, or configuration object. If `configuration_value` isn't specified, the returned variant's `Configuration`propertyis`None`.
401
401
402
402
A list of all possible variants is defined for each feature under the `variants`property.
403
403
@@ -479,22 +479,22 @@ The `allocation` setting of a feature has the following properties:
479
479
|`default_when_disabled`| Specifies which variant should be used when a variant is requested while the feature is considered disabled. |
480
480
|`default_when_enabled`| Specifies which variant should be used when a variant is requested while the feature is considered enabled and no other variant was assigned to the user. |
481
481
|`user`| Specifies a variant and a list of users to whom that variant should be assigned. |
482
-
|`group`| Specifies a variant and a list of groups. The variant will be assigned if the user isin at least one of the groups. |
482
+
|`group`| Specifies a variant and a list of groups. The variant is assigned if the user isin at least one of the groups. |
483
483
|`percentile`| Specifies a variant and a percentage range the user's calculated percentage has to fit into for that variant to be assigned. |
484
484
|`seed`| The value which percentage calculations for`percentile` are based on. The percentage calculation for a specific user will be the same across all features if the same `seed` value is used. If no `seed`is specified, then a default seed is created based on the feature name. |
485
485
486
-
In the above example, if the feature isn't enabled, the feature manager will assign the variant marked as `default_when_disabled` to the current user, which is `Small` in this case.
486
+
If the feature isn't enabled, the feature manager assigns the variant marked as `default_when_disabled` to the current user, which is `Small` in this case.
487
487
488
-
If the feature is enabled, the feature manager will check the `user`, `group`, and`percentile` allocations in that order to assign a variant. For this particular example, if the user being evaluated is named `Marsha`, in the group named `Ring1`, or the user happens to fall between the 0and10th percentile, then the specified variant is assigned to the user. In this case, all of the assigned users would return the `Big` variant. If none of these allocations match, the user is assigned the `default_when_enabled` variant, which is`Small`.
488
+
If the feature is enabled, the feature manager checks the `user`, `group`, and`percentile` allocations in that order to assign a variant. For this particular example, if the user being evaluated is named `Marsha`, in the group named `Ring1`, or the user happens to fall between the 0and10th percentile, then the specified variant is assigned to the user. In this case, all of the assigned users would return the `Big` variant. If none of these allocations match, the user is assigned the `default_when_enabled` variant, which is`Small`.
489
489
490
490
Allocation logic is similar to the [Microsoft.Targeting](#microsofttargeting) feature filter, but there are some parameters that are present in targeting that aren't in allocation, and vice versa. The outcomes of targeting and allocation aren't related.
491
491
492
492
493
493
### Overriding Enabled State with a Variant
494
494
495
-
You can use variants to override the enabled state of a feature flag. Overriding gives variants an opportunity to extend the evaluation of a feature flag. If a caller is checking a feature flag, that has variants, is enabled, the feature manager will check if the variant assigned to the targeted user has override configured. Overriding is done using the optional variant property`status_override`. By default, this propertyisset to `None`, which means the variant doesn't affect whether the flag is considered enabled or disabled. Setting `status_override` to `Enabled` allows the variant, when chosen, to override a flag to be enabled. Setting `status_override` to `Disabled` provides the opposite functionality, therefore disabling the flag when the variant is chosen. A feature with an `enabled` state of `false` can't be overridden.
495
+
You can use variants to override the enabled state of a feature flag. Overriding gives variants an opportunity to extend the evaluation of a feature flag. When calling `is_enabled` on a flagwithvariants, the Feature Manager will check if the variant assigned to the current user is configured to override the result. Overriding is done using the optional variant property`status_override`. By default, this propertyisset to `None`, which means the variant doesn't affect whether the flag is considered enabled or disabled. Setting `status_override` to `Enabled` allows the variant, when chosen, to override a flag to be enabled. Setting `status_override` to `Disabled` provides the opposite functionality, therefore disabling the flag when the variant is chosen. A feature with an `enabled` state of `false` can't be overridden.
496
496
497
-
If you're using a feature flag with binary variants, the `status_override` property can be very helpful. It allows you to continue using APIs like `is_enabled` in your application, all while benefiting from the new features that come with variants, such as percentile allocation and seed.
497
+
If you're using a feature flag with binary variants, the `status_override` property can be helpful. It allows you to continue using APIs like `is_enabled` in your application, all while benefiting from the new features that come with variants, such as percentile allocation and seed.
0 commit comments