Skip to content

Commit 0a2aaf2

Browse files
authored
Merge pull request #288372 from zhiyuanliang-ms/zhiyuanliang/add-feature-reference
Azure App Configuration - JS FM feature reference
2 parents 75d3ec3 + 9873c43 commit 0a2aaf2

11 files changed

+809
-29
lines changed

articles/azure-app-configuration/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@
359359
href: ./feature-management-python-reference.md
360360
- name: API reference
361361
href: https://microsoft.github.io/FeatureManagement-Python/html/index.html
362+
- name: JavaScript
363+
items:
364+
- name: Feature reference
365+
href: ./feature-management-javascript-reference.md
362366
- name: Deployment
363367
items:
364368
- name: ARM template

articles/azure-app-configuration/concept-feature-management.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ To start using feature flags with Azure App Configuration, continue to the follo
9393
> [!div class="nextstepaction"]
9494
> [Python](./quickstart-feature-flag-python.md)
9595
96+
> [!div class="nextstepaction"]
97+
> [JavaScript](./quickstart-feature-flag-javascript.md)
98+
9699
> [!div class="nextstepaction"]
97100
> [Azure Kubernetes Service](./quickstart-feature-flag-azure-kubernetes-service.md)
98101

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ The `feature_management` section of the json document is used by convention to l
104104

105105
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
106106

107-
#### RequirementType
107+
#### Requirement type
108108

109109
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`.
110110

@@ -844,7 +844,7 @@ When defining an Audience, users and groups can be excluded from the audience. E
844844
"RolloutPercentage": 100
845845
}
846846
],
847-
"DefaultRolloutPercentage": 0
847+
"DefaultRolloutPercentage": 0,
848848
"Exclusion": {
849849
"Users": [
850850
"Mark"
@@ -884,7 +884,7 @@ For each feature, a variant can be retrieved using the `IVariantFeatureManager`'
884884
885885
IVariantFeatureManager featureManager;
886886
887-
Variant variant = await featureManager.GetVariantAsync(MyFeatureFlags.FeatureU, CancellationToken.None);
887+
Variant variant = await featureManager.GetVariantAsync("MyVariantFeatureFlag", CancellationToken.None);
888888
889889
IConfigurationSection variantConfiguration = variant.Configuration;
890890

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

Lines changed: 737 additions & 0 deletions
Large diffs are not rendered by default.

articles/azure-app-configuration/feature-management-overview.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ This is an overview of each feature and its current status for different framewo
3737

3838
Feature | .NET | Spring | Python | JavaScript
3939
------- | ---- | ------ | ------ | ----------
40-
Targeting Filter | [GA](./feature-management-dotnet-reference.md#targeting) | GA | [GA](./feature-management-python-reference.md#targeting) | GA
41-
Targeting Exclusion | [GA](./feature-management-dotnet-reference.md#targeting-exclusion) | GA | [GA](./feature-management-python-reference.md#targeting-exclusion) | GA
42-
Time Window Filter | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | [GA](./feature-management-python-reference.md#microsofttimewindow) | GA
40+
Targeting Filter | [GA](./feature-management-dotnet-reference.md#targeting) | GA | [GA](./feature-management-python-reference.md#targeting) | [GA](./feature-management-javascript-reference.md#targeting)
41+
Targeting Exclusion | [GA](./feature-management-dotnet-reference.md#targeting-exclusion) | GA | [GA](./feature-management-python-reference.md#targeting-exclusion) | [GA](./feature-management-javascript-reference.md#targeting-exclusion)
42+
Time Window Filter | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | [GA](./feature-management-python-reference.md#microsofttimewindow) | [GA](./feature-management-javascript-reference.md#microsofttimewindow)
4343
Recurring Time Window | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | WIP | WIP
44-
Custom Feature Filter | [GA](./feature-management-dotnet-reference.md#implementing-a-feature-filter) | GA | [GA](./feature-management-python-reference.md#implementing-a-feature-filter) | GA
45-
Feature Filter Requirement Type (AND/OR) | [GA](./feature-management-dotnet-reference.md#requirementtype) | GA | [GA](./feature-management-python-reference.md#requirement_type) | GA
46-
Variant Feature Flag | [GA](./feature-management-dotnet-reference.md#variants) | GA | [GA](./feature-management-python-reference.md#variants) | GA
47-
Feature Flag Telemetry | [GA](./feature-management-dotnet-reference.md#telemetry) | GA | [GA](./feature-management-python-reference.md#telemetry) | GA
48-
Application Insights Integration | [GA](./feature-management-dotnet-reference.md#application-insights-telemetry) | GA | [GA](./feature-management-python-reference.md#application-insights-telemetry) | GA
44+
Custom Feature Filter | [GA](./feature-management-dotnet-reference.md#implementing-a-feature-filter) | GA | [GA](./feature-management-python-reference.md#implementing-a-feature-filter) | [GA](./feature-management-javascript-reference.md#implementing-a-feature-filter)
45+
Feature Filter Requirement Type (AND/OR) | [GA](./feature-management-dotnet-reference.md#requirement-type) | GA | [GA](./feature-management-python-reference.md#requirement-type) | [GA](./feature-management-javascript-reference.md#requirement-type)
46+
Variant Feature Flag | [GA](./feature-management-dotnet-reference.md#variants) | GA | [GA](./feature-management-python-reference.md#variants) | [GA](./feature-management-javascript-reference.md#variants)
47+
Feature Flag Telemetry | [GA](./feature-management-dotnet-reference.md#telemetry) | GA | [GA](./feature-management-python-reference.md#telemetry) | [GA](./feature-management-javascript-reference.md#telemetry)
48+
Application Insights Integration | [GA](./feature-management-dotnet-reference.md#application-insights-telemetry) | GA | [GA](./feature-management-python-reference.md#application-insights-telemetry) | [GA](./feature-management-javascript-reference.md#application-insights-integration)
4949
Feature Gate | [GA](./feature-management-dotnet-reference.md#controllers-and-actions) | GA | N/A | N/A
5050
Feature Gated Middleware | [GA](./feature-management-dotnet-reference.md#application-building) | GA | N/A | N/A

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ Here are some of the benefits of using Python feature management library:
3333
The Python feature management library is open source. For more information, visit the [GitHub repo](https://github.com/microsoft/FeatureManagement-Python).
3434

3535
## Feature flags
36+
3637
Feature flags are composed of two parts, a name and a list of feature-filters that are used to turn on the feature.
3738

3839
### Feature filters
40+
3941
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's considered disabled.
4042

4143
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,15 +56,15 @@ The feature management library supports json as a feature flag source. Below we
5456
"feature_flags": [
5557
{
5658
"id": "FeatureT",
57-
"enabled": "true"
59+
"enabled": true
5860
},
5961
{
6062
"id": "FeatureU",
61-
"enabled": "false"
63+
"enabled": false
6264
},
6365
{
6466
"id": "FeatureV",
65-
"enabled": "true",
67+
"enabled": true,
6668
"conditions": {
6769
"client_filters": [
6870
{
@@ -80,7 +82,7 @@ The feature management library supports json as a feature flag source. Below we
8082
}
8183
```
8284

83-
The `feature_management` section of the json document is used by convention to load feature flag settings. The `feature_flags` section is a list of the feature flags that are loaded into the library. In the section above, we see three different features. Features define their feature filters using the `client_filters` property, inside of `conditions`. In the feature filters for `FeatureT`, we see `enabled` is on with no filters defined, resulting in `FeatureT` always returning `true` . `FeatureU` is the same as `FeatureT` but with `enabled` is `false` resulting in the feature always returning `false`. `FeatureV` specifies a feature filter named `Microsoft.TimeWindow`. `FeatureV` is an example of a configurable feature filter. We can see in the example that the filter has a `parameters` property. The `parameters` property is used to configure the filter. In this case, the start and end times for the feature to be active are configured.
85+
The `feature_management` section of the json document is used by convention to load feature flag settings. The `feature_flags` section is a list of the feature flags that are loaded into the library. In the section above, we see three different features. Features define their feature filters using the `client_filters` property, inside of `conditions`. In the feature filters for `FeatureT`, we see `enabled` is `true` with no filters defined, resulting in `FeatureT` always returning `true` . `FeatureU` is the same as `FeatureT` but with `enabled` is `false` resulting in the feature always returning `false`. `FeatureV` specifies a feature filter named `Microsoft.TimeWindow`. `FeatureV` is an example of a configurable feature filter. We can see in the example that the filter has a `parameters` property. The `parameters` property is used to configure the filter. In this case, the start and end times for the feature to be active are configured.
8486

8587
The detailed schema of the `feature_management` section can be found [here](https://github.com/microsoft/FeatureManagement/blob/main/Schema/FeatureManagement.v2.0.0.schema.json).
8688

@@ -107,7 +109,7 @@ The following snippet demonstrates an alternative way to define a feature that c
107109
}
108110
```
109111

110-
#### Requirement_type
112+
#### Requirement type
111113

112114
The `requirement_type` property of a feature flag 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`.
113115

@@ -191,7 +193,6 @@ There are a two feature filters that come with the `FeatureManagement` package:
191193

192194
Each of the built-in feature filters has its own parameters. Here's the list of feature filters along with examples.
193195

194-
195196
### Microsoft.TimeWindow
196197

197198
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.
@@ -253,14 +254,14 @@ Targeting is a feature management strategy that enables developers to progressiv
253254

254255
The following steps demonstrate an example of a progressive rollout for a new 'Beta' feature:
255256

256-
1. Individual users Jeff and Alicia are granted access to the Beta
257-
2. Another user, Mark, asks to opt in and is included.
258-
3. Twenty percent of a group known as "Ring1" users are included in the Beta.
259-
5. The number of "Ring1" users included in the beta is bumped up to 100 percent.
260-
5. Five percent of the user base is included in the beta.
261-
6. The rollout percentage is bumped up to 100 percent and the feature is completely rolled out.
257+
1. Individual users Jeff and Alicia are granted access to the Beta.
258+
1. Another user, Mark, asks to opt in and is included.
259+
1. Twenty percent of a group known as "Ring1" users are included in the Beta.
260+
1. The number of "Ring1" users included in the Beta is bumped up to 100 percent.
261+
1. Five percent of the user base is included in the Beta.
262+
1. The rollout percentage is bumped up to 100 percent and the feature is completely rolled out.
262263

263-
This strategy for rolling out a feature is built in to the library through the included [Microsoft.Targeting](#microsofttargeting) feature filter.
264+
This strategy for rolling out a feature is built into the library through the included [Microsoft.Targeting](#microsofttargeting) feature filter.
264265

265266
### Targeting a user
266267

@@ -290,7 +291,7 @@ When defining an audience, users and groups can be excluded from the audience. E
290291
"RolloutPercentage": 100
291292
}
292293
],
293-
"DefaultRolloutPercentage": 0
294+
"DefaultRolloutPercentage": 0,
294295
"Exclusion": {
295296
"Users": [
296297
"Mark"
@@ -387,7 +388,7 @@ Each variant has two properties: a name and a configuration. The name is used to
387388

388389
A list of all possible variants is defined for each feature under the `variants` property.
389390

390-
``` javascript
391+
``` json
391392
{
392393
"feature_management": {
393394
"feature_flags": [
@@ -417,7 +418,7 @@ A list of all possible variants is defined for each feature under the `variants`
417418

418419
The process of allocating a feature's variants is determined by the `allocation` property of the feature.
419420

420-
``` javascript
421+
``` json
421422
"allocation": {
422423
"default_when_enabled": "Small",
423424
"default_when_disabled": "Small",

articles/azure-app-configuration/howto-feature-filters-javascript.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ To learn more about the built-in feature filters, continue to the following docu
7878
> [Enable features on a schedule](./howto-timewindow-filter.md)
7979

8080
> [!div class="nextstepaction"]
81-
> [Roll out features to targeted audience](./howto-targetingfilter.md)
81+
> [Roll out features to targeted audience](./howto-targetingfilter.md)
82+
83+
For the full feature rundown of the JavaScript feature management library, continue to the following document.
84+
85+
> [!div class="nextstepaction"]
86+
> [.NET Feature Management](./feature-management-javascript-reference.md)

articles/azure-app-configuration/howto-timewindow-filter-javascript.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ To learn more about the feature filters, continue to the following documents.
7575
7676
> [!div class="nextstepaction"]
7777
> [Roll out features to targeted audience](./howto-targetingfilter.md)
78+
79+
For the full feature rundown of the JavaScript feature management library, continue to the following document.
80+
81+
> [!div class="nextstepaction"]
82+
> [.NET Feature Management](./feature-management-javascript-reference.md)

articles/azure-app-configuration/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ landingContent:
178178
url: feature-management-python-reference.md
179179
- text: Python feature management API reference
180180
url: https://microsoft.github.io/FeatureManagement-Python/html/index.html
181+
- text: JavaScript feature management
182+
url: feature-management-javascript-reference.md
181183

182184
- title: Client libraries and tools
183185
linkLists:

articles/azure-app-configuration/manage-feature-flags.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ To start using feature flags with Azure App Configuration, continue to the follo
160160
> [!div class="nextstepaction"]
161161
> [Python](./quickstart-feature-flag-python.md)
162162
163+
> [!div class="nextstepaction"]
164+
> [JavaScript](./quickstart-feature-flag-javascript.md)
165+
163166
> [!div class="nextstepaction"]
164167
> [Azure Kubernetes Service](./quickstart-feature-flag-azure-kubernetes-service.md)
165168

0 commit comments

Comments
 (0)