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-dotnet-reference.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ The `FeatureManagement` section of the json document is used by convention to lo
147
147
148
148
The detailed schema of the `FeatureManagement` section can be found [here](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json).
149
149
150
-
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
150
+
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
151
151
152
152
#### On/Off Declaration
153
153
@@ -175,7 +175,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil
175
175
*`Any` means only one filter needs to evaluate to true for the feature to be enabled.
176
176
*`All` means every filter needs to evaluate to true for the feature to be enabled.
177
177
178
-
A `RequirementType` of `All` changes the traversal. First, if there are no filters, the feature is 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, it is considered enabled.
178
+
A `RequirementType` of `All` changes the traversal. First, if there are no filters, the feature is 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, it's considered enabled.
179
179
180
180
```JavaScript
181
181
"FeatureW": {
@@ -278,18 +278,18 @@ Below we have an example of declaring feature flags in a json file.
278
278
}
279
279
```
280
280
281
-
The `feature_management` section of the json document is used by convention to load feature flag settings. Feature flag objects must be listed in the `feature_flags` array under the `feature_management` section. In the section above, we see that we have provided three different features. A feature flag has `id` and `enabled` properties. The `id` is the name used to identify and reference the feature flag. The `enabled` property specifies the enabled state of the feature flag. A feature is *OFF* if `enabled` is false. If `enabled` is true, then the state of the feature depends on the `conditions`. If there are no `conditions` then the feature is *ON*. If there are `conditions` and they are met then the feature is *ON*. If there are `conditions` and they are not met then the feature is *OFF*. The `conditions` property declares the conditions used to dynamically enabled the feature. Features define their feature filters in the `client_filters` array. `FeatureV` specifies a feature filter named `Microsoft.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.
281
+
The `feature_management` section of the json document is used by convention to load feature flag settings. Feature flag objects must be listed in the `feature_flags` array under the `feature_management` section. In the section above, we see that we have provided three different features. A feature flag has `id` and `enabled` properties. The `id` is the name used to identify and reference the feature flag. The `enabled` property specifies the enabled state of the feature flag. A feature is *OFF* if `enabled` is false. If `enabled` is true, then the state of the feature depends on the `conditions`. If there are no `conditions` then the feature is *ON*. If there are `conditions` and they're met then the feature is *ON*. If there are `conditions` and they aren't met then the feature is *OFF*. The `conditions` property declares the conditions used to dynamically enable the feature. Features define their feature filters in the `client_filters` array. `FeatureV` specifies a feature filter named `Microsoft.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.
282
282
283
-
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
283
+
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
284
284
285
285
#### RequirementType
286
286
287
-
The `requirement_type` property of `conditions` is used to determine if the filters should use `Any` or `All` logic when evaluating the state of a feature. If `requirement_type`is not specified, the default value is `Any`.
287
+
The `requirement_type` property of `conditions` is used to determine if the filters should use `Any` or `All` logic when evaluating the state of a feature. If `requirement_type`isn't specified, the default value is `Any`.
288
288
289
289
*`Any` means only one filter needs to evaluate to true for the feature to be enabled.
290
290
*`All` means every filter needs to evaluate to true for the feature to be enabled.
291
291
292
-
A `requirement_type` of `All` changes the traversal. First, if there are no filters, the feature will be disabled. If there are filters, 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.
292
+
A `requirement_type` of `All` changes the traversal. First, if there is no filter, the feature will be disabled. If there are filters, 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.
293
293
294
294
```JavaScript
295
295
{
@@ -316,11 +316,11 @@ A `requirement_type` of `All` changes the traversal. First, if there are no filt
316
316
}
317
317
```
318
318
319
-
In the above example, `FeatureW` specifies a `requirement_type` of `All`, meaning all of it's 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.
319
+
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 will be enabled for 50% of users during the specified time window.
320
320
321
321
### .NET Feature Management schema
322
322
323
-
In previous versions, the primary schema for the feature management library was the [`.NET feature management schema`](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json). Starting from v4.0.0, new features including variants and telemetry will not be supported for the .NET feature management schema.
323
+
In previous versions, the primary schema for the feature management library was the [`.NET feature management schema`](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json). Starting from v4.0.0, new features including variants and telemetry won't be supported for the .NET feature management schema.
324
324
325
325
**Note:** If a feature flag written with `Microsoft Feature Management schema` can be found in the configuration, any feature flag written with `.NET feature management schema` will be ignored.
326
326
@@ -490,7 +490,7 @@ You can also negate the tag helper evaluation to display content when a feature
<p>This can only be seen if variant 'Alpha' of 'FeatureX' is not assigned.</p>
493
+
<p>This can only be seen if variant 'Alpha' of 'FeatureX' isn't assigned.</p>
494
494
</feature>
495
495
```
496
496
@@ -815,7 +815,7 @@ The `Recurrence` settings are made up of two parts: `Pattern` (how often the tim
815
815
816
816
#### Recurrence Pattern
817
817
818
-
There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every 3 days", "every Monday" or "every other Friday".
818
+
There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every three days", "every Monday" or "every other Friday".
819
819
820
820
Depending on the type, certain fields of the `Pattern` are required, optional, or ignored.
821
821
@@ -965,7 +965,7 @@ This filter provides the capability to enable a feature for a target audience. A
965
965
966
966
### Feature Filter Alias Namespaces
967
967
968
-
All of the built-in feature filter alias' are in the 'Microsoft' feature filter namespace. This is to prevent conflicts with other feature filters that may share the same alias. The segments of a feature filter namespace are split by the '.'character. A feature filter can be referenced by its fully qualified alias such as 'Microsoft.Percentage' or by the last segment which in the case of'Microsoft.Percentage' is 'Percentage'.
968
+
All of the built-in feature filter alias' are in the `Microsoft` feature filter namespace. This is to prevent conflicts with other feature filters that may share the same alias. The segments of a feature filter namespace are split by the '.'character. A feature filter can be referenced by its fully qualified alias such as `Microsoft.Percentage` or by the last segment which in the case of`Microsoft.Percentage` is `Percentage`.
969
969
970
970
## Targeting
971
971
@@ -1061,7 +1061,7 @@ When defining an Audience, users and groups can be excluded from the audience. T
1061
1061
}
1062
1062
```
1063
1063
1064
-
In the above example, the feature is enabled for users named `Jeff` and `Alicia`. It is also enabled for users in the group named `Ring0`. However, if the user is named `Mark`, the feature is disabled, regardless ofif they are in the group `Ring0` or not. Exclusions take priority over the rest of the targeting filter.
1064
+
In the above example, the feature is enabled for users named `Jeff` and `Alicia`. It's also enabled for users in the group named `Ring0`. However, if the user is named `Mark`, the feature is disabled, regardless of if they are in the group `Ring0` or not. Exclusions take priority over the rest of the targeting filter.
1065
1065
1066
1066
:::zone target="docs" pivot="preview-version"
1067
1067
@@ -1250,15 +1250,15 @@ In the above example, if the feature is not enabled, the feature manager will as
1250
1250
1251
1251
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 0 and 10th percentile, then the specified variant is assigned to the user. In this case, all of these would return the `Big` variant. If none of these allocations match, the user is assigned the `default_when_enabled` variant, which is `Small`.
1252
1252
1253
-
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 are not related.
1253
+
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.
1254
1254
1255
1255
**Note:** To allow allocating feature variants, you need to register `ITargetingContextAccessor`. This can be done by calling the `WithTargeting<T>` method.
1256
1256
1257
1257
### Overriding Enabled State with a Variant
1258
1258
1259
-
You can use variants to override the enabled state of a feature flag. This gives variants an opportunity to extend the evaluation of a feature flag. If a caller is checking whether a flag that has variants is enabled, the feature manager will check if the variant assigned to the current user is set up to override the result. This is done using the optional variant property `status_override`. By default, this property is set 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 a `Status`of`Disabled`cannot be overridden.
1259
+
You can use variants to override the enabled state of a feature flag. This gives variants an opportunity to extend the evaluation of a feature flag. If a caller is checking whether a flag that has variants is enabled, the feature manager will check if the variant assigned to the current user is set up to override the result. This is done using the optional variant property `status_override`. By default, this property is set 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 a `Status`of`Disabled`can't be overridden.
1260
1260
1261
-
If you are using a feature flag with binary variants, the `status_override` property can be very helpful. It allows you to continue using APIs like `IsEnabledAsync` and `FeatureGateAttribute`in your application, all while benefiting from the newfeatures that come with variants, such as percentile allocation and seed.
1261
+
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 `IsEnabledAsync` and `FeatureGateAttribute`in your application, all while benefiting from the newfeatures that come with variants, such as percentile allocation and seed.
1262
1262
1263
1263
``` javascript
1264
1264
{
@@ -1291,7 +1291,7 @@ In the above example, the feature is always enabled. If the current user is in t
1291
1291
1292
1292
### Variants in Dependency Injection
1293
1293
1294
-
Variant feature flags can be used in conjunction with dependency injection to surface different implementations of a service for different users. This is accomplished through the use of the `IVariantServiceProvider<TService>`interface.
1294
+
Variant feature flags can be used in conjunction with dependency injection to surface different implementations of a service for different users. This is accomplished by using the `IVariantServiceProvider<TService>`interface.
In the snippet above, the `IVariantServiceProvider<IAlgorithm>`will retrieve an implementation of`IAlgorithm` from the dependency injection container. The chosen implementation is dependent upon:
1303
+
In the snippet above, the `IVariantServiceProvider<IAlgorithm>`retrieves an implementation of`IAlgorithm` from the dependency injection container. The chosen implementation is dependent upon:
1304
1304
* The feature flag that the `IAlgorithm` service was registered with.
The call above makes `IVariantServiceProvider<IAlgorithm>` available in the service collection. Implementation(s)of`IAlgorithm` must be added separately via an add method such as `services.AddSingleton<IAlgorithm, SomeImplementation>()`. The implementation of`IAlgorithm` that the `IVariantServiceProvider` uses depends on the `ForecastAlgorithm` variant feature flag. If no implementation of`IAlgorithm` is added to the service collection, then the `IVariantServiceProvider<IAlgorithm>.GetServiceAsync()`will return a task with a *null* result.
1314
+
The call above makes `IVariantServiceProvider<IAlgorithm>` available in the service collection. Implementationsof`IAlgorithm` must be added separately via an add method such as `services.AddSingleton<IAlgorithm, SomeImplementation>()`. The implementation of`IAlgorithm` that the `IVariantServiceProvider` uses depends on the `ForecastAlgorithm` variant feature flag. If no implementation of`IAlgorithm` is added to the service collection, the `IVariantServiceProvider<IAlgorithm>.GetServiceAsync()`returns a task with a *null* result.
1315
1315
1316
1316
``` javascript
1317
1317
{
@@ -1341,7 +1341,7 @@ The variant service provider will use the type names of implementations to match
1341
1341
1342
1342
## Telemetry
1343
1343
1344
-
When a feature flag change is deployed, it is often important to analyze its effect on an application. For example, here are a few questions that may arise:
1344
+
When a feature flag change is deployed, it's often important to analyze its effect on an application. For example, here are a few questions that may arise:
1345
1345
1346
1346
* Are my flags enabled/disabled as expected?
1347
1347
* Are targeted users getting access to a certain feature as expected?
@@ -1352,9 +1352,9 @@ These types of questions can be answered through the emission and analysis of fe
1352
1352
1353
1353
### Enabling Telemetry
1354
1354
1355
-
By default, feature flags will not have telemetry emitted. To publish telemetry for a given feature flag, the flag *MUST* declare that it is enabled for telemetry emission.
1355
+
By default, feature flags don't have telemetry emitted. To publish telemetry for a given feature flag, the flag *MUST* declare that it is enabled for telemetry emission.
1356
1356
1357
-
For flags defined in`appsettings.json`, that is done by using the `telemetry` property on feature flags.
1357
+
For feature flags defined in`appsettings.json`, this is done by using the `telemetry` property.
1358
1358
1359
1359
``` javascript
1360
1360
{
@@ -1372,7 +1372,7 @@ For flags defined in `appsettings.json`, that is done by using the `telemetry` p
1372
1372
}
1373
1373
```
1374
1374
1375
-
The appsettings snippet above defines a feature flag named `MyFeatureFlag` that is enabled fortelemetry. This is indicated by the `telemetry` object which sets `enabled` to true. The value of the `enabled` property must be `true` to publish telemetry for the flag.
1375
+
The appsettings snippet above defines a feature flag named `MyFeatureFlag` that is enabled fortelemetry. This is indicated by the `telemetry` object that sets `enabled` to true. The value of the `enabled` property must be `true` to publish telemetry for the flag.
1376
1376
1377
1377
The `telemetry` section of a feature flag has the following properties:
1378
1378
@@ -1383,7 +1383,7 @@ The `telemetry` section of a feature flag has the following properties:
1383
1383
1384
1384
### Custom Telemetry Publishers
1385
1385
1386
-
Custom handling of feature flag telemetry is made possible by implementing an `ITelemetryPublisher` and registering it in the feature manager. Whenever a feature flag that has telemetry enabled is evaluated the registered telemetry publisher will get a chance to publish the corresponding evaluation event.
1386
+
Custom handling of feature flag telemetry is made possible by implementing an `ITelemetryPublisher` and registering it in the feature manager. Whenever a feature flag that has telemetry enabled is evaluated, the registered telemetry publisher gets a chance to publish the corresponding evaluation event.
1387
1387
1388
1388
``` C#
1389
1389
public interface ITelemetryPublisher
@@ -1394,7 +1394,7 @@ public interface ITelemetryPublisher
1394
1394
1395
1395
The `EvaluationEvent` type can be found [here](https://github.com/microsoft/FeatureManagement-Dotnet/blob/preview/src/Microsoft.FeatureManagement/Telemetry/EvaluationEvent.cs) for reference.
1396
1396
1397
-
Registering telemetry publishers is done when calling `AddFeatureManagement()`. Here is an example setting up feature management to emit telemetry with an implementation of`ITelemetryPublisher` called `MyTelemetryPublisher`.
1397
+
Registering telemetry publishers is done when calling `AddFeatureManagement()`. Here's an example setting up feature management to emit telemetry with an implementation of `ITelemetryPublisher` called `MyTelemetryPublisher`.
**Note:** The base `Microsoft.FeatureManagement`packagedoes not include this telemetry publisher.
1415
+
**Note:** The base `Microsoft.FeatureManagement` package doesn't include this telemetry publisher.
1416
1416
1417
1417
An example of its usage can be found in the [EvaluationDataToApplicationInsights](https://github.com/microsoft/FeatureManagement-Dotnet/tree/preview/examples/EvaluationDataToApplicationInsights) example.
0 commit comments