Skip to content

Commit 170759a

Browse files
update
1 parent 7f3665d commit 170759a

File tree

5 files changed

+38
-28
lines changed

5 files changed

+38
-28
lines changed

articles/azure-app-configuration/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@
336336
href: ./feature-management-python-reference.md
337337
- name: API reference
338338
href: https://microsoft.github.io/FeatureManagement-Python/html/index.html
339+
- name: JavaScript
340+
items:
341+
- name: Feature reference
342+
href: ./feature-management-javascript-reference.md
339343
- name: Deployment
340344
items:
341345
- name: ARM template

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ The `feature_management` section of the json document is used by convention to l
248248

249249
**Advanced:** The usage of colon ':' is forbidden in feature flag names.
250250

251-
#### Requirement type
251+
#### Requirement Type
252252

253253
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`.
254254

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

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ Here are some of the benefits of using JavaScript feature management library:
2828
* Low barrier to entry
2929
* Supports both JSON objects and map-based feature flag sources
3030
* Supports usage in both Node.js and browser environments
31-
* Feature Flag lifetime management with Azure App Configuration
31+
* Feature flag lifetime management with Azure App Configuration
3232
* Configuration values can change in real-time
3333
* Simple to Complex Scenarios Covered
3434
* Toggle on/off features through declarative configuration file
3535
* Dynamically evaluate state of feature based on call to server
3636

37-
The JavaScript feature management library is open source. For more information, visit the [GitHub repo](https://github.com/microsoft/FeatureManagement-JavaScript).
37+
The JavaScript feature management library is open source. For more information, visit the [GitHub repo](https://github.com/microsoft/FeatureManagement-JavaScript).
38+
39+
> [!NOTE]
40+
> It is recommended to use the feature management library together with Azure App Configuration. Azure App Configuration provides a solution for centrally managing application settings and feature flags. For more details, please refer to this [section](#use-feature-flags-from-azure-app-configuration).
3841
3942
## Feature flags
4043

@@ -74,27 +77,19 @@ const featureProvider = new ConfigurationMapFeatureFlagProvider(config);
7477
const featureManager = new FeatureManager(featureProvider);
7578
```
7679

77-
The object can also be parsed from a JSON file:
78-
79-
``` javascript
80-
const config = JSON.parse(await fs.readFile("path/to/config.json"));
81-
const featureProvider = new ConfigurationObjectFeatureFlagProvider(config);
82-
const featureManager = new FeatureManager(featureProvider);
83-
```
84-
85-
### [Use object Configuration](#tab/object-configuration)
80+
### [Use Object Configuration](#tab/object-configuration)
8681

8782
``` javascript
8883
const config = {
8984
"feature_management": {
9085
"feature_flags": [
9186
{
9287
"id": "FeatureT",
93-
"enabled": "true"
88+
"enabled": true
9489
},
9590
{
9691
"id": "FeatureX",
97-
"enabled": "false"
92+
"enabled": false
9893
}
9994
]
10095
},
@@ -106,40 +101,54 @@ const featureProvider = new ConfigurationObjectFeatureFlagProvider(config);
106101
const featureManager = new FeatureManager(featureProvider);
107102
```
108103

104+
The object can also be parsed from a JSON file:
105+
106+
``` javascript
107+
const config = JSON.parse(await fs.readFile("path/to/config.json"));
108+
const featureProvider = new ConfigurationObjectFeatureFlagProvider(config);
109+
const featureManager = new FeatureManager(featureProvider);
110+
```
111+
109112
---
110113

111114
### Use feature flags from Azure App Configuration
112115

116+
Rather than hard coding your feature flags into your application, we recommend that you keep feature flags outside the application and manage them separately. Doing so allows you to modify flag states at any time and have those changes take effect in the application right away. The Azure App Configuration service provides a dedicated portal UI for managing all of your feature flags. See the [tutorial](./manage-feature-flags.md).
117+
118+
The Azure App Configuration service also delivers the feature flags to your application directly through its JavaSript client library [@azure/app-configuration-provider](https://www.npmjs.com/package/@azure/app-configuration-provider). The following example shows how to use the library.
119+
113120
The App Configuration JavaScript provider provides feature flags in as a `Map` object. The built-in `ConfigurationMapFeatureFlagProvider` helps to load feature flags in this case.
114121

115122
``` javascript
123+
import { load } from "@azure/app-configuration-provider";
124+
116125
const appConfig = await load(connectionString, {featureFlagOptions: { enabled: true }}); // load feature flags from Azure App Configuration service
117126
const featureProvider = new ConfigurationMapFeatureFlagProvider(appConfig);
118127
const featureManager = new FeatureManager(featureProvider);
119128
```
120129

121130
> [!NOTE]
122-
> For more information about how to use feature management library with Azure App Configuration, pelase go to the [quickstart](./quickstart-javascript.md).
131+
> For more information about how to use feature management library with Azure App Configuration, please go to the [quickstart](./quickstart-javascript.md).
123132
124133
### Feature flag declaration
125134

126-
Below we have an example of the format used to set up feature flags in a JSON file.
135+
The following example shows the format used to set up feature flags in a JSON file.
127136

128137
```json
129138
{
130139
"feature_management": {
131140
"feature_flags": [
132141
{
133142
"id": "FeatureT",
134-
"enabled": "true"
143+
"enabled": true
135144
},
136145
{
137146
"id": "FeatureU",
138-
"enabled": "false"
147+
"enabled": false
139148
},
140149
{
141150
"id": "FeatureV",
142-
"enabled": "true",
151+
"enabled": true,
143152
"conditions": {
144153
"client_filters": [
145154
{
@@ -157,7 +166,7 @@ Below we have an example of the format used to set up feature flags in a JSON fi
157166
}
158167
```
159168

160-
The `feature_management` section 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.
169+
The `feature_management` section 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.
161170

162171
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).
163172

@@ -178,7 +187,7 @@ A `requirement_type` of `All` changes the traversal. First, if there are no filt
178187
"feature_flags": [
179188
{
180189
"id": "FeatureW",
181-
"enabled": "true",
190+
"enabled": true,
182191
"conditions": {
183192
"requirement_type": "All",
184193
"client_filters": [
@@ -697,8 +706,3 @@ To learn how to use feature filters, continue to the following tutorials.
697706
698707
> [!div class="nextstepaction"]
699708
> [Roll out features to targeted audiences](./howto-targetingfilter.md)
700-
701-
To learn how to run experiments with variant feature flags, continue to the following tutorial.
702-
703-
> [!div class="nextstepaction"]
704-
> [Run experiments with variant feature flags](./run-experiments-aspnet-core.md)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The feature management library supports json as a feature flag source. Below we
9494
}
9595
```
9696

97-
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.
97+
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.
9898

9999
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).
100100

@@ -626,4 +626,4 @@ To learn how to use feature filters, continue to the following tutorials.
626626
To learn how to run experiments with variant feature flags, continue to the following tutorial.
627627

628628
> [!div class="nextstepaction"]
629-
> [Run experiments with variant feature flags](./run-experiments-aspnet-core.md)
629+
> [Run experiments with variant feature flags](./howto-feature-filters.md)

articles/azure-app-configuration/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ landingContent:
176176
url: feature-management-python-reference.md
177177
- text: Python feature management API reference
178178
url: https://microsoft.github.io/FeatureManagement-Python/html/index.html
179+
- text: JavaScript feature management
180+
url: feature-management-javascript-reference.md
179181

180182
- title: Client libraries and tools
181183
linkLists:

0 commit comments

Comments
 (0)