From d90f4788b57a5d22cdf93e291960bef089678f7b Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Fri, 2 Feb 2024 14:55:47 +0800 Subject: [PATCH 1/7] schema file added --- ...eatureManagement.Dotnet.v1.0.0.schema.json | 91 +++++++++++++++++++ ...eatureManagement.Dotnet.v2.0.0.schema.json | 19 ++++ 2 files changed, 110 insertions(+) create mode 100644 schemas/FeatureManagement.Dotnet.v1.0.0.schema.json create mode 100644 schemas/FeatureManagement.Dotnet.v2.0.0.schema.json diff --git a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json new file mode 100644 index 00000000..49fc9210 --- /dev/null +++ b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json @@ -0,0 +1,91 @@ +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": ".NET Feature Management Configuration", + "required": [], + "patternProperties": { + "^[^:]*$": { + "description": "Declares a feature flag.", + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "required": [ + "EnabledFor" + ], + "properties": { + "RequirementType": { + "type": "string", + "title": "Requirement Type", + "description": "Determines whether any or all registered feature filters must be enabled for the feature to be considered enabled.", + "enum": [ + "Any", + "All" + ], + "default": "Any" + }, + "EnabledFor": { + "type": "array", + "title": "Feature Filter Collection", + "description": "Feature Filters that must be evaluated as true for the feature to be considered enabled.", + "items": { + "type": "object", + "title": "Feature Filter Declaration", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string", + "title": "Feature Filter Name", + "description": "The name used to refer to and require a feature filter.", + "default": "", + "examples": [ + "Percentage", + "TimeWindow" + ], + "pattern": "^[^:]*$" + }, + "Parameters": { + "type": "object", + "title": "Feature Filter Parameters", + "description": "Custom parameters for a given feature filter. A feature filter can require any set of parameters of any type.", + "required": [], + "patternProperties": { + "^.*$": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "type": "object" + }, + { + "type": "number" + }, + { + "type": "array" + }, + { + "type": "boolean" + } + ] + } + } + } + } + } + }, + "additionalProperties": false + } + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json new file mode 100644 index 00000000..24892ee4 --- /dev/null +++ b/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json @@ -0,0 +1,19 @@ +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": ".NET Feature Management Configuration", + "required": [ + "FeatureFlags" + ], + "properties": { + "FeatureFlags": { + "type": "array", + "title": "Feature Flags", + "description": "Declares feature flags based on Microsoft Feature Flag schema v1.1.0.", + "items": { + "$ref": "https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json" + } + } + } +} \ No newline at end of file From 1f4565b5f07eb045c7685c404adae3c88c8d8882 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Fri, 2 Feb 2024 15:34:07 +0800 Subject: [PATCH 2/7] README update --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index f7434116..d110f0d8 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,8 @@ The feature management library supports appsettings.json as a feature flag sourc The `FeatureManagement` section of the json document is used by convention to load feature flag settings. In the section above, we see that we have provided three different features. Features define their feature filters using the `EnabledFor` property. In the feature filters for `FeatureT` we see `AlwaysOn`. This feature filter is built-in and if specified will always enable the feature. The `AlwaysOn` feature filter does not require any configuration, so it only has the `Name` property. `FeatureU` has no filters in its `EnabledFor` property and thus will never be enabled. Any functionality that relies on this feature being enabled will not be accessible as long as the feature filters remain empty. However, as soon as a feature filter is added that enables the feature it can begin working. `FeatureV` specifies a feature filter named `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. +The detailed schema of the `FeatureManagement` section can be found [here](./schemas/FeatureManagement.Dotnet.v1.0.0.schema.json). + **Advanced:** The usage of colon ':' in feature flag names is forbidden. #### On/Off Declaration @@ -144,6 +146,12 @@ A `RequirementType` of `All` changes the traversal. First, if there are no filte In the above example, `FeatureW` specifies a `RequirementType` 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. +#### Microsoft Feature Flag Schema + +The feature management library also supports the usage of [`Microsoft Feature Flag schema``](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. + +If you want to use the `Microsoft Feature Flag schema`, you will need to follow [this schema](./schemas/FeatureManagement.Dotnet.v2.0.0.schema.json) to set up the `FeatureManagement` section of the configuration. + ## Consumption 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 the `IFeatureManager`'s `IsEnabledAsync` method. From 2f38364d524fbb771127ef79cd7a314a3be7bcb8 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Mon, 5 Feb 2024 14:06:32 +0800 Subject: [PATCH 3/7] update --- README.md | 2 +- ...eatureManagement.Dotnet.v1.0.0.schema.json | 101 ++++++++++-------- .../ConfigurationFeatureDefinitionProvider.cs | 10 +- 3 files changed, 56 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index d110f0d8..9366f2f6 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning #### Microsoft Feature Flag Schema -The feature management library also supports the usage of [`Microsoft Feature Flag schema``](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. +The feature management library also supports the usage of [`Microsoft Feature Flag schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. If you want to use the `Microsoft Feature Flag schema`, you will need to follow [this schema](./schemas/FeatureManagement.Dotnet.v2.0.0.schema.json) to set up the `FeatureManagement` section of the configuration. diff --git a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json index 49fc9210..68a07683 100644 --- a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json +++ b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json @@ -28,59 +28,66 @@ "default": "Any" }, "EnabledFor": { - "type": "array", - "title": "Feature Filter Collection", - "description": "Feature Filters that must be evaluated as true for the feature to be considered enabled.", - "items": { - "type": "object", - "title": "Feature Filter Declaration", - "required": [ - "Name" - ], - "properties": { - "Name": { - "type": "string", - "title": "Feature Filter Name", - "description": "The name used to refer to and require a feature filter.", - "default": "", - "examples": [ - "Percentage", - "TimeWindow" - ], - "pattern": "^[^:]*$" - }, - "Parameters": { + "oneOf": [ + { + "type": "array", + "title": "Feature Filter Collection", + "description": "Feature Filters that must be evaluated as true for the feature to be considered enabled.", + "items": { "type": "object", - "title": "Feature Filter Parameters", - "description": "Custom parameters for a given feature filter. A feature filter can require any set of parameters of any type.", - "required": [], - "patternProperties": { - "^.*$": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - }, - { - "type": "object" - }, - { - "type": "number" - }, - { - "type": "array" - }, - { - "type": "boolean" + "title": "Feature Filter Declaration", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string", + "title": "Feature Filter Name", + "description": "The name used to refer to and require a feature filter.", + "default": "", + "examples": [ + "Percentage", + "TimeWindow" + ], + "pattern": "^[^:]*$" + }, + "Parameters": { + "type": "object", + "title": "Feature Filter Parameters", + "description": "Custom parameters for a given feature filter. A feature filter can require any set of parameters of any type.", + "required": [], + "patternProperties": { + "^.*$": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "type": "object" + }, + { + "type": "number" + }, + { + "type": "array" + }, + { + "type": "boolean" + } + ] } - ] + } } } } + }, + { + "type": "boolean" } - } + ] }, "additionalProperties": false } diff --git a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs index 6e940760..d766a069 100644 --- a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs +++ b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs @@ -197,14 +197,6 @@ We support myDisabledFeature: { enabledFor: [ ] }, - myFeature2: { - enabledFor: "myFeatureFilter1;myFeatureFilter2" - }, - myDisabledFeature2: { - enabledFor: "" - }, - myFeature3: "myFeatureFilter1;myFeatureFilter2", - myDisabledFeature3: "", myAlwaysEnabledFeature: true, myAlwaysDisabledFeature: false // removing this line would be the same as setting it to false myAlwaysEnabledFeature2: { @@ -216,7 +208,7 @@ We support myAllRequiredFilterFeature: { requirementType: "all" enabledFor: [ "myFeatureFilter1", "myFeatureFilter2" ], - }, + } */ From 5af13bda0bd7f57abb5cdd62ed88c3faad1a8ca1 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Mon, 5 Feb 2024 14:13:58 +0800 Subject: [PATCH 4/7] update --- .../ConfigurationFeatureDefinitionProvider.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs index d766a069..4ec5d69c 100644 --- a/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs +++ b/src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs @@ -192,7 +192,7 @@ private FeatureDefinition ParseFeatureDefinition(IConfigurationSection configura We support myFeature: { - enabledFor: [ "myFeatureFilter1", "myFeatureFilter2" ] + enabledFor: [{name: "myFeatureFilter1"}, {name: "myFeatureFilter2"}] }, myDisabledFeature: { enabledFor: [ ] @@ -206,8 +206,8 @@ We support enabledFor: false }, myAllRequiredFilterFeature: { - requirementType: "all" - enabledFor: [ "myFeatureFilter1", "myFeatureFilter2" ], + requirementType: "all", + enabledFor: [{name: "myFeatureFilter1"}, {name: "myFeatureFilter2"}] } */ From 6d9a63340161a326907b4aafe692a1a1fa29cfdc Mon Sep 17 00:00:00 2001 From: zhiyuanliang Date: Tue, 6 Feb 2024 21:14:14 +0800 Subject: [PATCH 5/7] update README & remove the Microsoft schema file --- README.md | 57 ++++++++++++++++--- ...eatureManagement.Dotnet.v1.0.0.schema.json | 10 +++- ...eatureManagement.Dotnet.v2.0.0.schema.json | 19 ------- 3 files changed, 55 insertions(+), 31 deletions(-) delete mode 100644 schemas/FeatureManagement.Dotnet.v2.0.0.schema.json diff --git a/README.md b/README.md index 9366f2f6..0586fecc 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The .NET Core configuration system is used to determine the state of feature fla The feature management library supports appsettings.json as a feature flag source since it is a provider for .NET Core's IConfiguration system. Below we have an example of the format used to set up feature flags in a json file. -``` JavaScript +``` json { "Logging": { "LogLevel": { @@ -98,7 +98,7 @@ The detailed schema of the `FeatureManagement` section can be found [here](./sch #### On/Off Declaration The following snippet demonstrates an alternative way to define a feature that can be used for on/off features. -``` JavaScript +``` Json { "Logging": { "LogLevel": { @@ -123,7 +123,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil A `RequirementType` of `All` changes the traversal. First, if there are no filters, the feature will be 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, then it will be considered enabled. -``` +``` json "FeatureW": { "RequirementType": "All", "EnabledFor": [ @@ -150,7 +150,46 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning The feature management library also supports the usage of [`Microsoft Feature Flag schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. -If you want to use the `Microsoft Feature Flag schema`, you will need to follow [this schema](./schemas/FeatureManagement.Dotnet.v2.0.0.schema.json) to set up the `FeatureManagement` section of the configuration. +If you want to use the `Microsoft Feature Flag schema`, you will need to follow the Azure App Configuration Feature Management Configuration schema to set up feature flags. The schema can be found [here](https://github.com/Azure/AppConfiguration/tree/main/docs/FeatureManagement). The feature flag declarations should be listed in the `FeatureFlags` array under the `FeatureManagement` section, as shown in the example below: + +```json +{ + "FeatureManagement": { + "FeatureFlags": [ + { + "id": "AlwaysEnabledFeatureFlag", + "enabled": true + }, + { + "id": "AlwaysDisabledFeatureFlag", + "enabled": false + }, + { + "id": "ConditionalFeatureFlag", + "enabled": true, + "conditions": { + "requirement_type": "All", + "client_filters": [ + { + "name": "TimeWindow", + "parameters": { + "Start": "Mon, 01 May 2023 13:59:59 GMT", + "End": "Sat, 01 July 2023 00:00:00 GMT" + } + }, + { + "name": "Percentage", + "parameters": { + "Value": "50" + } + } + ] + } + } + ] + } +} +``` ## Consumption @@ -399,7 +438,7 @@ public class BrowserFilter : IFeatureFilter When a feature filter is registered to be used 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. -``` JavaScript +``` json "MyFeature": { "EnabledFor": [ { @@ -517,7 +556,7 @@ Each of the built-in feature filters have their own parameters. Here is the list This filter provides the capability to enable a feature based on a set percentage. -``` JavaScript +``` json "EnhancedPipeline": { "EnabledFor": [ { @@ -534,7 +573,7 @@ This filter provides the capability to enable a feature based on a set percentag This filter provides the capability to enable a feature based on a time window. If only `End` is specified, the feature will be considered on until that time. If only `Start` is specified, the feature will be considered on at all points after that time. -``` JavaScript +``` json "EnhancedPipeline": { "EnabledFor": [ { @@ -552,7 +591,7 @@ This filter provides the capability to enable a feature based on a time window. This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the [targeting](./README.md#Targeting) section below. The filter parameters include an audience object which 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 target audience 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 will be 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. -``` JavaScript +``` json "EnhancedPipeline": { "EnabledFor": [ { @@ -666,7 +705,7 @@ services.Configure(options => ### Targeting Exclusion When defining an Audience, users and groups can be excluded from the audience. This is useful when a feature is being rolled out to a group of users, but a few users or groups need to be excluded from the rollout. Exclusion is defined by adding a list of users and groups to the `Exclusion` property of the audience. -``` JavaScript +``` json "Audience": { "Users": [ "Jeff", diff --git a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json index 68a07683..fc9a9235 100644 --- a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json +++ b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json @@ -2,17 +2,21 @@ "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "title": ".NET Feature Management Configuration", + "title": "A.NET Feature Management Configuration", "required": [], "patternProperties": { "^[^:]*$": { "description": "Declares a feature flag.", - "oneOf": [ + "anyOf": [ { - "type": "boolean" + "type": "boolean", + "title": "On/Off Feature Flag", + "description": "A feature flag that always returns the same value." }, { "type": "object", + "title": "Conditional Feature Flag", + "description": "A feature flag which value is dynamic based on a set of feature filters", "required": [ "EnabledFor" ], diff --git a/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json deleted file mode 100644 index 24892ee4..00000000 --- a/schemas/FeatureManagement.Dotnet.v2.0.0.schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "title": ".NET Feature Management Configuration", - "required": [ - "FeatureFlags" - ], - "properties": { - "FeatureFlags": { - "type": "array", - "title": "Feature Flags", - "description": "Declares feature flags based on Microsoft Feature Flag schema v1.1.0.", - "items": { - "$ref": "https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json" - } - } - } -} \ No newline at end of file From b181942360af6066ad5e1e17075c15e16b7a1fb2 Mon Sep 17 00:00:00 2001 From: zhiyuanliang Date: Sun, 18 Feb 2024 13:07:06 +0800 Subject: [PATCH 6/7] update readme --- README.md | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0586fecc..d6aef9a0 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The .NET Core configuration system is used to determine the state of feature fla The feature management library supports appsettings.json as a feature flag source since it is a provider for .NET Core's IConfiguration system. Below we have an example of the format used to set up feature flags in a json file. -``` json +``` JavaScript { "Logging": { "LogLevel": { @@ -98,7 +98,7 @@ The detailed schema of the `FeatureManagement` section can be found [here](./sch #### On/Off Declaration The following snippet demonstrates an alternative way to define a feature that can be used for on/off features. -``` Json +``` JavaScript { "Logging": { "LogLevel": { @@ -123,7 +123,7 @@ The `RequirementType` property of a feature flag is used to determine if the fil A `RequirementType` of `All` changes the traversal. First, if there are no filters, the feature will be 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, then it will be considered enabled. -``` json +``` JavaScript "FeatureW": { "RequirementType": "All", "EnabledFor": [ @@ -150,38 +150,23 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning The feature management library also supports the usage of [`Microsoft Feature Flag schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. -If you want to use the `Microsoft Feature Flag schema`, you will need to follow the Azure App Configuration Feature Management Configuration schema to set up feature flags. The schema can be found [here](https://github.com/Azure/AppConfiguration/tree/main/docs/FeatureManagement). The feature flag declarations should be listed in the `FeatureFlags` array under the `FeatureManagement` section, as shown in the example below: +If you want to use the `Microsoft Feature Flag schema`, you will need to follow the `Microsoft Feature Management Configuration schema` to set up feature flags. The schema can be found [here](https://github.com/Azure/AppConfiguration/tree/main/docs/FeatureManagement). The feature flag declarations should be listed in the `feature_flags` array under the `feature_management` section, as shown in the example below: -```json +```JavaScript { - "FeatureManagement": { - "FeatureFlags": [ - { - "id": "AlwaysEnabledFeatureFlag", - "enabled": true - }, + "feature_management": { + "feature_flags": [ { - "id": "AlwaysDisabledFeatureFlag", - "enabled": false - }, - { - "id": "ConditionalFeatureFlag", + "id": "FeatureT", "enabled": true, "conditions": { - "requirement_type": "All", "client_filters": [ { - "name": "TimeWindow", + "name": "Microsoft.TimeWindow", "parameters": { "Start": "Mon, 01 May 2023 13:59:59 GMT", "End": "Sat, 01 July 2023 00:00:00 GMT" } - }, - { - "name": "Percentage", - "parameters": { - "Value": "50" - } } ] } @@ -191,6 +176,8 @@ If you want to use the `Microsoft Feature Flag schema`, you will need to follow } ``` +**Note:** If `feature_management` section can be found in the configuration, the `FeatureManagement` section will be ignored. + ## Consumption 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 the `IFeatureManager`'s `IsEnabledAsync` method. @@ -438,7 +425,7 @@ public class BrowserFilter : IFeatureFilter When a feature filter is registered to be used 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. -``` json +``` JavaScript "MyFeature": { "EnabledFor": [ { @@ -556,7 +543,7 @@ Each of the built-in feature filters have their own parameters. Here is the list This filter provides the capability to enable a feature based on a set percentage. -``` json +``` JavaScript "EnhancedPipeline": { "EnabledFor": [ { @@ -573,7 +560,7 @@ This filter provides the capability to enable a feature based on a set percentag This filter provides the capability to enable a feature based on a time window. If only `End` is specified, the feature will be considered on until that time. If only `Start` is specified, the feature will be considered on at all points after that time. -``` json +``` JavaScript "EnhancedPipeline": { "EnabledFor": [ { @@ -591,7 +578,7 @@ This filter provides the capability to enable a feature based on a time window. This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the [targeting](./README.md#Targeting) section below. The filter parameters include an audience object which 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 target audience 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 will be 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. -``` json +``` JavaScript "EnhancedPipeline": { "EnabledFor": [ { @@ -705,7 +692,7 @@ services.Configure(options => ### Targeting Exclusion When defining an Audience, users and groups can be excluded from the audience. This is useful when a feature is being rolled out to a group of users, but a few users or groups need to be excluded from the rollout. Exclusion is defined by adding a list of users and groups to the `Exclusion` property of the audience. -``` json +``` JavaScript "Audience": { "Users": [ "Jeff", From e70c80636a98cd8e0aa6fb8feb3047b3e20a5734 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Wed, 21 Feb 2024 11:12:57 +0800 Subject: [PATCH 7/7] update --- README.md | 8 +++----- schemas/FeatureManagement.Dotnet.v1.0.0.schema.json | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d6aef9a0..0081da9a 100644 --- a/README.md +++ b/README.md @@ -146,11 +146,9 @@ A `RequirementType` of `All` changes the traversal. First, if there are no filte In the above example, `FeatureW` specifies a `RequirementType` 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. -#### Microsoft Feature Flag Schema +#### Microsoft Feature Management Schema -The feature management library also supports the usage of [`Microsoft Feature Flag schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureFlag.v1.1.0.schema.json) to declare feature flags. - -If you want to use the `Microsoft Feature Flag schema`, you will need to follow the `Microsoft Feature Management Configuration schema` to set up feature flags. The schema can be found [here](https://github.com/Azure/AppConfiguration/tree/main/docs/FeatureManagement). The feature flag declarations should be listed in the `feature_flags` array under the `feature_management` section, as shown in the example below: +The feature management library also supports the usage of the [`Microsoft Feature Management schema`](https://github.com/Azure/AppConfiguration/blob/main/docs/FeatureManagement/FeatureManagement.v1.0.0.schema.json) to declare feature flags. This schema is language agnostic in origin and is supported by all Microsoft feature management libraries. ```JavaScript { @@ -176,7 +174,7 @@ If you want to use the `Microsoft Feature Flag schema`, you will need to follow } ``` -**Note:** If `feature_management` section can be found in the configuration, the `FeatureManagement` section will be ignored. +**Note:** If the `feature_management` section can be found in the configuration, the `FeatureManagement` section will be ignored. ## Consumption diff --git a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json index fc9a9235..430a68b5 100644 --- a/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json +++ b/schemas/FeatureManagement.Dotnet.v1.0.0.schema.json @@ -2,7 +2,7 @@ "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "title": "A.NET Feature Management Configuration", + "title": "The .NET Feature Management Schema", "required": [], "patternProperties": { "^[^:]*$": { @@ -36,7 +36,7 @@ { "type": "array", "title": "Feature Filter Collection", - "description": "Feature Filters that must be evaluated as true for the feature to be considered enabled.", + "description": "Feature filters that are evaluated to conditionally enable the flag.", "items": { "type": "object", "title": "Feature Filter Declaration",