You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/enable-dynamic-configuration-javascript.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ You can connect to App Configuration using either Microsoft Entra ID (recommende
80
80
});
81
81
82
82
```
83
+
83
84
---
84
85
85
86
1. Setting up `refreshOptions` alone won't automatically refresh the configuration. You need to call the `refresh` method to trigger a refresh. This design prevents unnecessary requests to App Configuration when your application is idle. You should include the `refresh` call where your application activity occurs. This is known as **activity-driven configuration refresh**. For example, you can call `refresh` when processing an incoming message or an order, or inside an iteration where you perform a complex task. Alternatively, you can use a timer if your application is always active. In this example, `refresh` is called in a loop for demonstration purposes. Even if the `refresh` call fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured refresh interval has passed and the `refresh` call is triggered by your application activity. Calling `refresh` is a no-op before the configured refresh interval elapses, so its performance impact is minimal even if it's called frequently.
@@ -141,6 +142,7 @@ You can connect to App Configuration using either Microsoft Entra ID (recommende
141
142
142
143
run().catch(console.error);
143
144
```
145
+
144
146
### [Use configuration as object](#tab/configuration-object)
Update the `AzureAppConfigurationProvider` resource of your Azure App Configuration Kubernetes Provider. Add a `replicaDiscoveryEnabled` property and set it to `false`.
> The automatic replica discovery support is available if you use version **1.3.0** or later.
161
161
162
+
### [JavaScript](#tab/javascript)
163
+
164
+
Specify the `AzureAppConfigurationOptions.replicaDiscoveryEnabled` property when loading the configuration store and set it to `false`.
165
+
166
+
167
+
```javascript
168
+
const config = load(endpoint, credential, {
169
+
replicaDiscoveryEnabled: false
170
+
});
171
+
```
172
+
173
+
> [!NOTE]
174
+
> The automatic replica discovery support is available if you use version **2.0.0-preview.2** or later of [@azure/app-configuration-provider](https://www.npmjs.com/package/@azure/app-configuration-provider).
175
+
> The feature is not available for browser-based applications due to the restriction of browser security sandbox.
176
+
162
177
---
163
178
164
179
## Scale and failover with replicas
@@ -245,6 +260,10 @@ The Azure App Configuration Kubernetes Provider supports failover with automatic
245
260
246
261
The Azure App Configuration Python Provider supports failover with automatically discovered replicas by default, as long as automatic replica discovery isn't disabled. It doesn't support or require user-provided replicas.
247
262
263
+
### [JavaScript](#tab/javascript)
264
+
265
+
The Azure App Configuration JavaScript Provider supports failover with automatically discovered replicas by default, as long as automatic replica discovery isn't disabled. It doesn't support or require user-provided replicas.
266
+
248
267
---
249
268
250
269
The failover may occur if the App Configuration provider observes the following conditions.
@@ -288,7 +307,7 @@ This feature isn't yet supported in the Azure App Configuration Java Spring Prov
288
307
289
308
Update the `AzureAppConfigurationProvider` resource of your Azure App Configuration Kubernetes Provider. Add a `loadBalancingEnabled` property and set it to `true`.
290
309
291
-
```yaml
310
+
```yaml
292
311
apiVersion: azconfig.io/v1
293
312
kind: AzureAppConfigurationProvider
294
313
metadata:
@@ -307,6 +326,19 @@ spec:
307
326
308
327
This feature isn't yet supported in the Azure App Configuration Python Provider.
309
328
329
+
### [JavaScript](#tab/javascript)
330
+
331
+
Set `AzureAppConfigurationOptions.loadBalancingEnabled` to `true` while loading configuration from App Configuration.
332
+
333
+
```javascript
334
+
const config = load(endpoint, credential, {
335
+
loadBalancingEnabled: true
336
+
});
337
+
```
338
+
339
+
> [!NOTE]
340
+
> Load balancing support is available if you use version **2.0.0-preview.2** or later of [@azure/app-configuration-provider](https://www.npmjs.com/package/@azure/app-configuration-provider).
0 commit comments