Skip to content

Commit 41ec58a

Browse files
wip
1 parent 41b088f commit 41ec58a

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

articles/azure-app-configuration/reference-javascript-provider.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,66 @@ The `AzureAppConfiguration` type extends the following interfaces:
120120

121121
### Load specific key-values using selectors
122122

123-
### Load feature flag
123+
By default, the `load` method will load all configurations with null label from the configuration store. You can configure the behavior of the `load` method through the optional parameter of [`AzureAppConfigurationOptions`](https://github.com/Azure/AppConfiguration-JavaScriptProvider/blob/main/src/AzureAppConfigurationOptions.ts) type.
124+
125+
To refine or expand the configurations loaded from the App Configuration store, you can specify the key or label selectors under the `AzureAppConfigurationOptions.selectors` property.
126+
127+
```typescript
128+
const settings = await load(endpoint, credential, {
129+
selectors: [
130+
{ // load the subset of keys starting with "app1." prefix and "test" label
131+
keyFilter: "app1.*",
132+
labelFilter: "test"
133+
},
134+
{ // load the subset of keys starting with "dev" label"
135+
labelFilter: "dev*"
136+
}
137+
]
138+
});
139+
```
140+
141+
> [!NOTE]
142+
> Key-values are loaded in the order the selectors are listed. If multiple selectors retrieve key-values with the same key, the value from the last one will override any previously loaded value.
124143

125144
### Trim prefix from keys
126145

127146
## Use Key Vault reference
128147

148+
## Dynamic refresh
129149

150+
### Watch sentinel key for refresh (Deprecated)
130151

131-
## Dynamic refresh
152+
## Use feature flag
132153

133-
### Watch sentinel key for refresh
154+
You can [create feature flags](./manage-feature-flags.md#create-a-feature-flag) in the Azure App Configuration. By default, the feature flags will not be loaded by configuration provider. You can enable loading and refreshing feature flags through `AzureAppConfigurationOptions.featureFlagOptions` property when calling the `load` method.
155+
156+
```typescript
157+
const settings = await load(endpoint, credential, {
158+
featureFlagOptions: {
159+
enabled: true,
160+
selectors: [ { keyFilter: "*" } ],
161+
refresh: {
162+
enabled: true,
163+
refreshIntervalInMs: 10_000
164+
}
165+
}
166+
});
167+
```
168+
169+
> [!NOTE]
170+
> Selectors for feature flags must be explicitly provided. Otherwise, an exception will be thrown.
171+
172+
### Feature management
173+
174+
Feature management library provides a way to develop and expose application functionality based on feature flags. The feature management libary is designed to work in conjunction with configuration provider library. It consumes the feature flags loaded from Azure App Configuration store and manage the feature flags for your application. For more information about how to use JavaScript feature management library, please go to the [quickstart](./quickstart-feature-flag-javascript.md).
134175

135176
## Enable failover with geo replicas
136177

137-
### Enable load balancing
178+
### Enable load balancing
179+
180+
## Next steps
181+
182+
To learn how to use JavaScript configuration provider, continue to the following tutorials.
183+
184+
> [!div class="nextstepaction"]
185+
> [Use dynamic configuration in JavaScript](./enable-dynamic-configuration-javascript.md)

0 commit comments

Comments
 (0)