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/java/spring-framework/app-configuration-support.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ In this example, if both the stores have the same configuration key, then the co
144
144
145
145
### Selecting configurations
146
146
147
-
Configurations are loaded by their key and label. By default, the configurations that start with the key `/application/` are loaded. The default label is `\0` which appears as `(No Label)` in the Azure portal. If a Spring profile is set, and no label is provided, then the default label is your Spring Profiles i.e.`${spring.profiles.active}`.
147
+
The library loads configurations using their key and label. By default, the configurations that start with the key `/application/` are loaded. The default label is `\0`, which appears as `(No Label)` in the Azure portal. If a Spring profile is set, and no label is provided, then the default label is your Spring Profiles which is`${spring.profiles.active}`.
148
148
149
149
You can configure which configurations are loaded by selecting different key and label filters:
150
150
@@ -172,7 +172,7 @@ The `label-filter` property supports the following filters:
172
172
|`1.0.*`| Matches labels that start with `1.0.*`. |
173
173
|`,1.0.0`| Matches labels `null` and `1.0.0`. Limited to five comma-separated values. |
174
174
175
-
If you're using YAML with label filters, and you need to start with `,`, then the label filter needs to be surrounded by single quotes. This allows you to load configuration with no label first, followed by configurations with specific labels in the same filter:
175
+
If you're using YAML with label filters, and you want to load configuration with no label and more configurations with other labels you need to include an empty `,` for example `,dev` will match `\0` and `dev`, then the label filter needs to be surrounded by single quotes. This allows you to load configuration with no label first, followed by configurations with specific labels in the same filter:
In the first `label-filter`, all configurations with the `\0` label are loaded, followed by all configurations matching the Spring Profiles. Spring Profiles have priority over the `\0` configurations, because they're at the end.
202
+
In the first `label-filter`, the library first loads all configurations with the `\0` label, followed by all configurations matching the Spring Profiles. Spring Profiles have priority over the `\0` configurations, because they're at the end.
203
203
204
204
In the second `label-filter`, the string `_local` is appended to the end of the Spring Profiles, though only to the last Spring Profile if there is more than one.
If all provided replica endpoints fail, the library attempts to connect to auto discovered replicas of the primary store.
281
281
282
-
This can be disabled with the setting `spring.cloud.azure.appconfiguration.stores[0].replica-discovery-enabled=false`.
282
+
Replication can be disabled with the setting `spring.cloud.azure.appconfiguration.stores[0].replica-discovery-enabled=false`.
283
283
284
284
### Creating a configuration store with geo-replication
285
285
@@ -298,7 +298,7 @@ Azure App Configuration supports multiple types of key values, some of which hav
298
298
The library supports configurations with `${}`-style environment placeholders. When referencing an Azure App Configuration key with a placeholder, remove prefixes from the reference. For example, `/application/config.message` is referenced as `${config.message}`.
299
299
300
300
> [!NOTE]
301
-
> The prefix being removed matches the value `spring.cloud.azure.appconfiguration.stores[0].selects[0].key-filter`. This can be changed by setting a value for `spring.cloud.azure.appconfiguration.stores[0].trim-key-prefix[0]`.
301
+
> The prefix being removed matches the value `spring.cloud.azure.appconfiguration.stores[0].selects[0].key-filter`. The prefix being trimmed can be changed by setting a value for `spring.cloud.azure.appconfiguration.stores[0].trim-key-prefix[0]`.
302
302
303
303
### JSON
304
304
@@ -331,7 +331,7 @@ public class MyConfigurations {
331
331
332
332
### Key Vault references
333
333
334
-
Azure App Configuration and its libraries support referencing secrets stored in Key Vault. In App Configuration, you can create keys with values that map to secrets stored in a Key Vault. Secrets are securely stored in Key Vault, but can be accessed in the same way as any other configuration after it's loaded.
334
+
Azure App Configuration and its libraries support referencing secrets stored in Key Vault. In App Configuration, you can create keys with values that map to secrets stored in a Key Vault. Secrets remain secure in Key Vault, but you can access them in the same way as any other configuration when loading the app.
335
335
336
336
Your application uses the client provider to retrieve Key Vault references, just as it does for any other keys stored in App Configuration. Because the client recognizes the keys as Key Vault references, they have a unique content-type, and the client connects to Key Vault to retrieve their values for you.
337
337
@@ -445,7 +445,7 @@ feature-management:
445
445
This example has the following feature flags:
446
446
447
447
- `feature-t`is set to `false`. This setting always returns the feature flag's value.
448
-
- `feature-u`is used with feature filters. These filters are defined under the `enabled-for` property. In this case, `feature-u` has one feature filter called `Random`, which doesn't require any configuration, so only the name property is required.
448
+
- `feature-u`is used with feature filters. These filters are defined under the `enabled-for` property. In this case, `feature-u` has one feature filter called `Random`, which doesn't require any configuration, so only the name property is required.
449
449
- `feature-v`specifies a feature filter named `TimeWindowFilter`. This feature filter can be passed parameters to use as configuration. In this example, a `TimeWindowFilter`, passes in the start and end times during which the feature is active.
450
450
- `feature-w`is used for the `AlwaysOnFilter`, which always evaluates to `true`. The `evaluate` field is used to stop the evaluation of the feature filters, and results in the feature filter always returning `false`.
451
451
@@ -473,7 +473,7 @@ if (featureManager.isEnabled("feature-t")) {
473
473
> [!NOTE]
474
474
> `FeatureManager` also has an asynchronous version of `isEnabled` called `isEnabledAsync`.
475
475
476
-
If you haven't configured feature management or the feature flag doesn't exist, `isEnabled` always returns `false`. If an existing feature flag is configured with an unknown feature filter, then a `FilterNotFoundException` is thrown. You can change this behavior to return `false` by configuring `fail-fast` to `false`. The following table describes `fail-fast`:
476
+
Without feature management configuration or when the feature flag does not exist, `isEnabled` always returns `false`. If an existing feature flag is configured with an unknown feature filter, then a `FilterNotFoundException` is thrown. You can change this behavior to return `false` by configuring `fail-fast` to `false`. The following table describes `fail-fast`:
@@ -716,7 +716,7 @@ Options are available to customize how targeting evaluation is performed across
716
716
717
717
Enabling config refresh for your configurations lets you pull their latest values from your App Configuration store or stores without having to restart the application.
718
718
719
-
To enable refresh, you need to enable monitoring along with monitoring triggers. A monitoring trigger is a key with an optional label that's checked for value changes to trigger updates. The value of the monitoring trigger can be any value, as long as it changes when a refresh is needed.
719
+
To enable refresh, you need to enable monitoring along with monitoring triggers. A monitoring trigger is a key with an optional label which the system monitors for value changes to trigger updates. The value of the monitoring trigger can be any value, as long as it changes when a refresh is needed.
720
720
721
721
> [!NOTE]
722
722
> Any operation that changes the ETag of a monitoring trigger causes a refresh, such as a content-type change.
When the refresh interval ends and the system attempts a refresh, it checks all triggers in the given store for changes. Any change to the key causes a refresh to trigger. Because the libraries integrate with the Spring refresh system, any refresh reloads all configurations from all stores. You can set the refresh interval to any interval longer than 1 second. The supported units for the refresh interval are `s`, `m`, `h`, and `d` for seconds, minutes, hours, and days respectively. The following example sets the refresh interval to 5 minutes:
759
+
```
760
+
761
+
#### Automated
762
+
758
763
When you use the `spring-cloud-azure-appconfiguration-config-web` library, the application automatically checks for a refresh whenever a servlet request occurs, specifically `ServletRequestHandledEvent`. The most common way this event is sent is by requests to endpoints in a `@RestController`.
759
764
760
765
#### Manual
@@ -776,7 +781,7 @@ The `appconfiguration-refresh` property expires the refresh interval, so the rem
In addition to exposing the refresh endpoints, a required query parameter has been added for security. No token name or value is set by default, but setting one is required in order to use the endpoints, as shown in the following example:
784
+
In addition to exposing the refresh endpoints, the library requires a query parameter for security. No token name or value exists by default, but you must set one to use the endpoints, as shown in the following example:
@@ -810,7 +815,7 @@ Because Azure Key Vault stores the public and private key pair of a certificate
810
815
811
816
### Feature flag refresh
812
817
813
-
If feature flags and monitoring are both enabled, then by default the refresh interval for feature flags is set to 30 seconds. After the refresh interval has passed, all feature flags are checked in the given store for changes. Any change to the key causes a refresh to trigger. Because the libraries integrate with the Spring refresh system, any refresh reloads all configurations from all stores. You can set the refresh interval to any interval longer than 1 second. The supported units for the refresh interval are `s`, `m`, `h`, and `d` for seconds, minutes, hours, and days respectively. The following example sets the refresh interval to 5 minutes:
818
+
If feature flags and monitoring are both enabled, then by default the refresh interval for feature flags is set to 30 seconds. When the refresh interval ends, the system checks all feature flags in the given store for changes. Any change to the key causes a refresh to trigger. Because the libraries integrate with the Spring refresh system, any refresh reloads all configurations from all stores. You can set the refresh interval to any interval longer than 1 second. The supported units for the refresh interval are `s`, `m`, `h`, and `d` for seconds, minutes, hours, and days respectively. The following example sets the refresh interval to 5 minutes:
@@ -843,7 +848,7 @@ public interface SecretClientCustomizer {
843
848
These interfaces allow for customization of the HTTP client and its configurations. The following example replaces the default `HttpClient` with another one that uses a proxy for all traffic directed to App Configuration and Key Vault.
844
849
845
850
> [!NOTE]
846
-
> The `ConfigurationClientBuilder` and `SecretClientBuilder` are already set up for use when passed into `customize`. Any changes to the clients, including the credentials and retry policy, override those already in place.
851
+
> The `ConfigurationClientBuilder` and `SecretClientBuilder` are already set up for use when passed into `customize`. Any changes to the clients, including the credentials and retry policy, override the defaults already in place.
847
852
>
848
853
> You can also do this configuration by using [Spring Cloud Azure configuration](configuration.md).
0 commit comments