Skip to content

Commit 83eed81

Browse files
increase acrolinx score
1 parent 13b8122 commit 83eed81

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

articles/azure-app-configuration/feature-management-dotnet-reference.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The `FeatureManagement` section of the json document is used by convention to lo
147147

148148
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).
149149

150-
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
150+
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
151151

152152
#### On/Off Declaration
153153

@@ -175,7 +175,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil
175175
* `Any` means only one filter needs to evaluate to true for the feature to be enabled.
176176
* `All` means every filter needs to evaluate to true for the feature to be enabled.
177177

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.
179179

180180
``` JavaScript
181181
"FeatureW": {
@@ -278,18 +278,18 @@ Below we have an example of declaring feature flags in a json file.
278278
}
279279
```
280280

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.
282282

283-
**Advanced:** The usage of colon ':' in feature flag names is forbidden.
283+
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
284284

285285
#### RequirementType
286286

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`.
288288

289289
* `Any` means only one filter needs to evaluate to true for the feature to be enabled.
290290
* `All` means every filter needs to evaluate to true for the feature to be enabled.
291291

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.
293293

294294
``` JavaScript
295295
{
@@ -316,11 +316,11 @@ A `requirement_type` of `All` changes the traversal. First, if there are no filt
316316
}
317317
```
318318

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.
320320

321321
### .NET Feature Management schema
322322

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.
324324

325325
**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.
326326

@@ -490,7 +490,7 @@ You can also negate the tag helper evaluation to display content when a feature
490490

491491
``` HTML+Razor
492492
<feature negate="true" name="FeatureX" variant="Alpha">
493-
<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>
494494
</feature>
495495
```
496496

@@ -815,7 +815,7 @@ The `Recurrence` settings are made up of two parts: `Pattern` (how often the tim
815815

816816
#### Recurrence Pattern
817817

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".
819819

820820
Depending on the type, certain fields of the `Pattern` are required, optional, or ignored.
821821

@@ -965,7 +965,7 @@ This filter provides the capability to enable a feature for a target audience. A
965965
966966
### Feature Filter Alias Namespaces
967967
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`.
969969

970970
## Targeting
971971

@@ -1061,7 +1061,7 @@ When defining an Audience, users and groups can be excluded from the audience. T
10611061
}
10621062
```
10631063

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 of if 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.
10651065
10661066
:::zone target="docs" pivot="preview-version"
10671067
@@ -1250,15 +1250,15 @@ In the above example, if the feature is not enabled, the feature manager will as
12501250
12511251
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`.
12521252
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.
12541254
12551255
**Note:** To allow allocating feature variants, you need to register `ITargetingContextAccessor`. This can be done by calling the `WithTargeting<T>` method.
12561256
12571257
### Overriding Enabled State with a Variant
12581258
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.
12601260
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 new features 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 new features that come with variants, such as percentile allocation and seed.
12621262

12631263
``` javascript
12641264
{
@@ -1291,7 +1291,7 @@ In the above example, the feature is always enabled. If the current user is in t
12911291

12921292
### Variants in Dependency Injection
12931293

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.
12951295

12961296
``` C#
12971297
IVariantServiceProvider<IAlgorithm> algorithmServiceProvider;
@@ -1300,7 +1300,7 @@ IVariantServiceProvider<IAlgorithm> algorithmServiceProvider;
13001300
IAlgorithm forecastAlgorithm = await algorithmServiceProvider.GetServiceAsync(cancellationToken);
13011301
```
13021302

1303-
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:
13041304
* The feature flag that the `IAlgorithm` service was registered with.
13051305
* The allocated variant for that feature.
13061306

@@ -1311,7 +1311,7 @@ services.AddFeatureManagement()
13111311
.WithVariantService<IAlgorithm>("ForecastAlgorithm");
13121312
```
13131313

1314-
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. Implementations 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, the `IVariantServiceProvider<IAlgorithm>.GetServiceAsync()` returns a task with a *null* result.
13151315

13161316
``` javascript
13171317
{
@@ -1341,7 +1341,7 @@ The variant service provider will use the type names of implementations to match
13411341

13421342
## Telemetry
13431343

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:
13451345
13461346
* Are my flags enabled/disabled as expected?
13471347
* 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
13521352
13531353
### Enabling Telemetry
13541354
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.
13561356

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.
13581358

13591359
``` javascript
13601360
{
@@ -1372,7 +1372,7 @@ For flags defined in `appsettings.json`, that is done by using the `telemetry` p
13721372
}
13731373
```
13741374

1375-
The appsettings snippet above defines a feature flag named `MyFeatureFlag` that is enabled for telemetry. 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 for telemetry. 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.
13761376

13771377
The `telemetry` section of a feature flag has the following properties:
13781378

@@ -1383,7 +1383,7 @@ The `telemetry` section of a feature flag has the following properties:
13831383

13841384
### Custom Telemetry Publishers
13851385

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.
13871387

13881388
``` C#
13891389
public interface ITelemetryPublisher
@@ -1394,7 +1394,7 @@ public interface ITelemetryPublisher
13941394

13951395
The `EvaluationEvent` type can be found [here](https://github.com/microsoft/FeatureManagement-Dotnet/blob/preview/src/Microsoft.FeatureManagement/Telemetry/EvaluationEvent.cs) for reference.
13961396

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`.
13981398
13991399
``` C#
14001400
builder.services
@@ -1412,7 +1412,7 @@ builder.services
14121412
.AddTelemetryPublisher<ApplicationInsightsTelemetryPublisher>();
14131413
```
14141414
1415-
**Note:** The base `Microsoft.FeatureManagement` package does not include this telemetry publisher.
1415+
**Note:** The base `Microsoft.FeatureManagement` package doesn't include this telemetry publisher.
14161416

14171417
An example of its usage can be found in the [EvaluationDataToApplicationInsights](https://github.com/microsoft/FeatureManagement-Dotnet/tree/preview/examples/EvaluationDataToApplicationInsights) example.
14181418

0 commit comments

Comments
 (0)