Skip to content

Commit 5312cc8

Browse files
Merge pull request #304635 from zhiyuanliang-ms/zhiyuanliang/update-dotnet-fm
Azure App Configuration - Update feature filter example to using Microsoft feature flag schema
2 parents 250424d + 7c8f314 commit 5312cc8

2 files changed

Lines changed: 81 additions & 69 deletions

File tree

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

Lines changed: 81 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,16 @@ public class BrowserFilter : IFeatureFilter
478478
When a feature filter is registered for a feature flag, the alias used in configuration is the name of the feature filter type with the _Filter_ suffix, if any, removed. For example, `MyCriteriaFilter` would be referred to as _MyCriteria_ in configuration.
479479

480480
``` JavaScript
481-
"MyFeature": {
482-
"EnabledFor": [
483-
{
484-
"Name": "MyCriteria"
485-
}
486-
]
481+
{
482+
"id": "MyFeature",
483+
"enabled": true,
484+
"conditions": {
485+
"client_filters": [
486+
{
487+
"name": "MyCriteria"
488+
}
489+
]
490+
}
487491
}
488492
```
489493
This name can be overridden by using the `FilterAliasAttribute`. A feature filter can be decorated with this attribute to declare the name that should be used in configuration to reference this feature filter within a feature flag.
@@ -596,15 +600,19 @@ Each of the built-in feature filters has its own parameters. Here's the list of
596600
This filter provides the capability to enable a feature based on a set percentage.
597601

598602
``` JavaScript
599-
"EnhancedPipeline": {
600-
"EnabledFor": [
601-
{
602-
"Name": "Microsoft.Percentage",
603-
"Parameters": {
604-
"Value": 50
603+
{
604+
"id": "EnhancedPipeline",
605+
"enabled": true,
606+
"conditions": {
607+
"client_filters": [
608+
{
609+
"name": "Microsoft.Percentage",
610+
"parameters": {
611+
"Value": 50
612+
}
605613
}
606-
}
607-
]
614+
]
615+
}
608616
}
609617
```
610618

@@ -613,16 +621,20 @@ This filter provides the capability to enable a feature based on a set percentag
613621
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.
614622

615623
``` JavaScript
616-
"EnhancedPipeline": {
617-
"EnabledFor": [
618-
{
619-
"Name": "Microsoft.TimeWindow",
620-
"Parameters": {
621-
"Start": "Wed, 01 May 2019 13:59:59 GMT",
622-
"End": "Mon, 01 Jul 2019 00:00:00 GMT"
624+
{
625+
"id": "EnhancedPipeline",
626+
"enabled": true,
627+
"conditions": {
628+
"client_filters": [
629+
{
630+
"name": "Microsoft.TimeWindow",
631+
"parameters": {
632+
"Start": "Wed, 01 May 2019 13:59:59 GMT",
633+
"End": "Mon, 01 Jul 2019 00:00:00 GMT"
634+
}
623635
}
624-
}
625-
]
636+
]
637+
}
626638
}
627639
```
628640

@@ -632,26 +644,24 @@ The time window can be configured to recur periodically. This can be useful for
632644
> `Start` and `End` must be both specified to enable `Recurrence`.
633645
634646
``` JavaScript
635-
"EnhancedPipeline": {
636-
"EnabledFor": [
637-
{
638-
"Name": "Microsoft.TimeWindow",
639-
"Parameters": {
640-
"Start": "Fri, 22 Mar 2024 20:00:00 GMT",
641-
"End": "Sat, 23 Mar 2024 02:00:00 GMT",
642-
"Recurrence": {
643-
"Pattern": {
644-
"Type": "Daily",
645-
"Interval": 1
646-
},
647-
"Range": {
648-
"Type": "NoEnd"
649-
}
647+
"client_filters": [
648+
{
649+
"name": "Microsoft.TimeWindow",
650+
"parameters": {
651+
"Start": "Fri, 22 Mar 2024 20:00:00 GMT",
652+
"End": "Sat, 23 Mar 2024 02:00:00 GMT",
653+
"Recurrence": {
654+
"Pattern": {
655+
"Type": "Daily",
656+
"Interval": 1
657+
},
658+
"Range": {
659+
"Type": "NoEnd"
650660
}
651661
}
652662
}
653-
]
654-
}
663+
}
664+
]
655665
```
656666

657667
The `Recurrence` settings are made up of two parts: `Pattern` (how often the time window repeats) and `Range` (for how long the recurrence pattern repeats).
@@ -769,39 +779,43 @@ To create a recurrence rule, you must specify both `Pattern` and `Range`. Any pa
769779
This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the [targeting](#targeting) section. The filter parameters include an `Audience` object that describes users, groups, excluded users/groups, and a default percentage of the user base that should have access to the feature. Each group object that is listed in the `Groups` section must also specify what percentage of the group's members should have access. If a user is specified in the `Exclusion` section, either directly or if the user is in an excluded group, the feature is disabled. Otherwise, if a user is specified in the `Users` section directly, or if the user is in the included percentage of any of the group rollouts, or if the user falls into the default rollout percentage then that user will have the feature enabled.
770780
771781
``` JavaScript
772-
"EnhancedPipeline": {
773-
"EnabledFor": [
774-
{
775-
"Name": "Microsoft.Targeting",
776-
"Parameters": {
777-
"Audience": {
778-
"Users": [
779-
"Jeff",
780-
"Alicia"
781-
],
782-
"Groups": [
783-
{
784-
"Name": "Ring0",
785-
"RolloutPercentage": 100
786-
},
787-
{
788-
"Name": "Ring1",
789-
"RolloutPercentage": 50
790-
}
791-
],
792-
"DefaultRolloutPercentage": 20,
793-
"Exclusion": {
782+
{
783+
"id": "EnhancedPipeline",
784+
"enabled": true,
785+
"conditions": {
786+
"client_filters": [
787+
{
788+
"name": "Microsoft.Targeting",
789+
"parameters": {
790+
"Audience": {
794791
"Users": [
795-
"Ross"
792+
"Jeff",
793+
"Alicia"
796794
],
797795
"Groups": [
798-
"Ring2"
799-
]
796+
{
797+
"Name": "Ring0",
798+
"RolloutPercentage": 100
799+
},
800+
{
801+
"Name": "Ring1",
802+
"RolloutPercentage": 50
803+
}
804+
],
805+
"DefaultRolloutPercentage": 20,
806+
"Exclusion": {
807+
"Users": [
808+
"Ross"
809+
],
810+
"Groups": [
811+
"Ring2"
812+
]
813+
}
800814
}
801815
}
802816
}
803-
}
804-
]
817+
]
818+
}
805819
}
806820
```
807821

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ This filter provides the capability to enable a feature based on a time window.
360360
]
361361
```
362362

363-
364363
The time window can be configured to recur periodically. This can be useful for the scenarios where one may need to turn on a feature during a low or high traffic period of a day or certain days of a week. To expand the individual time window to recurring time windows, the recurrence rule should be specified in the `Recurrence` parameter.
365364

366365
> [!NOTE]
@@ -497,7 +496,6 @@ To create a recurrence rule, you must specify both `Pattern` and `Range`. Any pa
497496

498497
**Advanced:** The time zone offset of the `Start` property is applied to the recurrence settings.
499498

500-
501499
### Microsoft.Targeting
502500

503501
This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the [targeting](#targeting) section below. The filter parameters include an `Audience` object that describes users, groups, excluded users/groups, and a default percentage of the user base that should have access to the feature. Each group object that is listed in the `Groups` section must also specify what percentage of the group's members should have access. If a user is specified in the `Exclusion` section, either directly or if the user is in an excluded group, the feature is disabled. Otherwise, if a user is specified in the `Users` section directly, or if the user is in the included percentage of any of the group rollouts, or if the user falls into the default rollout percentage then that user will have the feature enabled.

0 commit comments

Comments
 (0)