Skip to content

Commit 12522ed

Browse files
Merge pull request #263172 from mrm9084/main
Azure Spring Cloud App Configuration Updates
2 parents 6dff5a7 + 655f07b commit 12522ed

6 files changed

+48
-15
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-java-spring-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Then, open the *pom.xml* file in a text editor and add a `<dependency>` for `spr
123123
<dependency>
124124
<groupId>com.azure.spring</groupId>
125125
<artifactId>spring-cloud-azure-appconfiguration-config-web</artifactId>
126-
<version>5.4.0</version>
126+
<version>5.8.0</version>
127127
</dependency>
128128
```
129129
@@ -133,7 +133,7 @@ Then, open the *pom.xml* file in a text editor and add a `<dependency>` for `spr
133133
<dependency>
134134
<groupId>com.azure.spring</groupId>
135135
<artifactId>spring-cloud-azure-appconfiguration-config-web</artifactId>
136-
<version>4.10.0</version>
136+
<version>4.14.0</version>
137137
</dependency>
138138
```
139139

articles/azure-app-configuration/enable-dynamic-configuration-java-spring-push-refresh.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ In this tutorial, you learn how to:
7070
<dependency>
7171
<groupId>com.azure.spring</groupId>
7272
<artifactId>spring-cloud-azure-dependencies</artifactId>
73-
<version>5.5.0</version>
73+
<version>5.8.0</version>
7474
<type>pom</type>
7575
<scope>import</scope>
7676
</dependency>
@@ -84,7 +84,6 @@ In this tutorial, you learn how to:
8484
<dependency>
8585
<groupId>com.azure.spring</groupId>
8686
<artifactId>spring-cloud-azure-appconfiguration-config-web</artifactId>
87-
<version>4.10.0</version>
8887
</dependency>
8988

9089
<!-- Adds the Ability to Push Refresh -->
@@ -98,7 +97,7 @@ In this tutorial, you learn how to:
9897
<dependency>
9998
<groupId>com.azure.spring</groupId>
10099
<artifactId>spring-cloud-azure-dependencies</artifactId>
101-
<version>4.11.0</version>
100+
<version>4.14.0</version>
102101
<type>pom</type>
103102
<scope>import</scope>
104103
</dependency>
@@ -115,7 +114,7 @@ In this tutorial, you learn how to:
115114
mvn com.microsoft.azure:azure-webapp-maven-plugin:2.5.0:config
116115
```
117116

118-
1. Open bootstrap.properties and configure Azure App Configuration Push Refresh and Azure Service Bus
117+
1. Open bootstrap.properties and configure Azure App Configuration Push Refresh.
119118

120119
```properties
121120
# Azure App Configuration Properties
@@ -201,7 +200,10 @@ Event Grid Web Hooks require validation on creation. You can validate by followi
201200
:::image type="content" source="./media/event-subscription-view-webhook.png" alt-text="Web Hook shows up in a table on the bottom of the page." :::
202201
203202
> [!NOTE]
204-
> When subscribing for configuration changes, one or more filters can be used to reduce the number of events sent to your application. These can be configured either as [Event Grid subscription filters](../event-grid/event-filtering.md) or [Service Bus subscription filters](../service-bus-messaging/topic-filters.md). For example, a subscription filter can be used to only subscribe to events for changes in a key that starts with a specific string.
203+
> When subscribing for configuration changes, one or more filters can be used to reduce the number of events sent to your application. These can be configured either as [Event Grid subscription filters](../event-grid/event-filtering.md). For example, a subscription filter can be used to only subscribe to events for changes in a key that starts with a specific string.
204+
205+
> [!NOTE]
206+
> If you have multiple instances of your application running, you can use the `appconfiguration-refresh-bus` endpoint which requires setting up Azure Service Bus, which is used to send a message to all instances of your application to refresh their configuration. This is useful if you have multiple instances of your application running and want to ensure that all instances are updated with the latest configuration. This endpoint isn't available unless you have `spring-cloud-bus` as a dependency with it configured. See the [Azure Service Bus Spring Cloud Bus documentation](/azure/developer/java/spring-framework/using-service-bus-in-spring-applications) for more information. The service bus connection only needs to be set up and the Azure App Configuration library will handle sending and receiving the messages.
205207
206208
## Verify and test application
207209

articles/azure-app-configuration/howto-convert-to-the-new-spring-boot.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ All of the group and artifact IDs in the Azure libraries for Spring Boot have be
4545
<dependency>
4646
<groupId>com.azure.spring</groupId>
4747
<artifactId>spring-cloud-azure-dependencies</artifactId>
48-
<version>5.5.0</version>
48+
<version>5.8.0</version>
4949
<type>pom</type>
5050
<scope>import</scope>
5151
</dependency>
@@ -78,7 +78,7 @@ All of the group and artifact IDs in the Azure libraries for Spring Boot have be
7878
<dependency>
7979
<groupId>com.azure.spring</groupId>
8080
<artifactId>spring-cloud-azure-dependencies</artifactId>
81-
<version>4.11.0</version>
81+
<version>4.14.0</version>
8282
<type>pom</type>
8383
<scope>import</scope>
8484
</dependency>
@@ -120,6 +120,37 @@ spring.cloud.azure.appconfiguration.stores[0].monitoring.feature-flag-refresh-in
120120

121121
The property `spring.cloud.azure.appconfiguration.stores[0].feature-flags.label` has been removed. Instead, you can use `spring.cloud.azure.appconfiguration.stores[0].feature-flags.selects[0].label-filter` to specify a label filter.
122122

123+
## Using Client Customizers
124+
125+
`ConfigurationClientCustomizer` and `SecretClientCustomizer` are used to customize the `ConfigurationClient` and `SecretClient` instances. You can use them to modify the clients before they're used to connect to App Configuration. This allows for using any credential type supported by the [Azure Identity library](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md#credential-classes). You can also modify the clients to set a custom `HttpClient` or `HttpPipeline`.
126+
127+
```java
128+
import com.azure.core.credential.TokenCredential;
129+
import com.azure.data.appconfiguration.ConfigurationClientBuilder;
130+
import com.azure.identity.AzureCliCredential;
131+
import com.azure.identity.AzureCliCredentialBuilder;
132+
import com.azure.identity.ChainedTokenCredential;
133+
import com.azure.identity.ChainedTokenCredentialBuilder;
134+
import com.azure.identity.EnvironmentCredentialBuilder;
135+
import com.azure.identity.ManagedIdentityCredential;
136+
import com.azure.identity.ManagedIdentityCredentialBuilder;
137+
import com.azure.spring.cloud.appconfiguration.config.ConfigurationClientCustomizer;
138+
139+
public class ConfigurationClientCustomizerImpl implements ConfigurationClientCustomizer {
140+
141+
@Override
142+
public void customize(ConfigurationClientBuilder builder, String endpoint) {
143+
AzureCliCredential cliCredential = new AzureCliCredentialBuilder().build();
144+
String managedIdentityClientId = System.getenv("MANAGED_IDENTITY_CLIENT_ID");
145+
ManagedIdentityCredential managedIdentityCredential = new ManagedIdentityCredentialBuilder()
146+
.clientId(managedIdentityClientId).build();
147+
ChainedTokenCredential credential = new ChainedTokenCredentialBuilder().addLast(cliCredential)
148+
.addLast(managedIdentityCredential).build();
149+
builder.credential(credential);
150+
}
151+
}
152+
```
153+
123154
## Possible conflicts with Spring Cloud Azure global properties
124155

125156
[Spring Cloud Azure common configuration properties](/azure/developer/java/spring-framework/configuration) enable you to customize your connections to Azure services. The new App Configuration library will pick up any global or App Configuration setting that's configured with Spring Cloud Azure common configuration properties. Your connection to App Configuration will change if the configurations are set for another Spring Cloud Azure library.

articles/azure-app-configuration/quickstart-feature-flag-spring-boot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To create a new Spring Boot project:
7373
<dependency>
7474
<groupId>com.azure.spring</groupId>
7575
<artifactId>spring-cloud-azure-dependencies</artifactId>
76-
<version>5.5.0</version>
76+
<version>5.8.0</version>
7777
<type>pom</type>
7878
<scope>import</scope>
7979
</dependency>
@@ -102,7 +102,7 @@ To create a new Spring Boot project:
102102
<dependency>
103103
<groupId>com.azure.spring</groupId>
104104
<artifactId>spring-cloud-azure-dependencies</artifactId>
105-
<version>4.11.0</version>
105+
<version>4.14.0</version>
106106
<type>pom</type>
107107
<scope>import</scope>
108108
</dependency>

articles/azure-app-configuration/quickstart-java-spring-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To install the Spring Cloud Azure Config starter module, add the following depen
5151
<dependency>
5252
<groupId>com.azure.spring</groupId>
5353
<artifactId>spring-cloud-azure-dependencies</artifactId>
54-
<version>5.5.0</version>
54+
<version>5.8.0</version>
5555
<type>pom</type>
5656
<scope>import</scope>
5757
</dependency>
@@ -72,7 +72,7 @@ To install the Spring Cloud Azure Config starter module, add the following depen
7272
<dependency>
7373
<groupId>com.azure.spring</groupId>
7474
<artifactId>spring-cloud-azure-dependencies</artifactId>
75-
<version>4.11.0</version>
75+
<version>4.14.0</version>
7676
<type>pom</type>
7777
<scope>import</scope>
7878
</dependency>

articles/azure-app-configuration/use-feature-flags-spring-boot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The easiest way to connect your Spring Boot application to App Configuration is
6262
<dependency>
6363
<groupId>com.azure.spring</groupId>
6464
<artifactId>spring-cloud-azure-dependencies</artifactId>
65-
<version>5.5.0</version>
65+
<version>5.8.0</version>
6666
<type>pom</type>
6767
<scope>import</scope>
6868
</dependency>
@@ -83,7 +83,7 @@ The easiest way to connect your Spring Boot application to App Configuration is
8383
<dependency>
8484
<groupId>com.azure.spring</groupId>
8585
<artifactId>spring-cloud-azure-dependencies</artifactId>
86-
<version>4.11.0</version>
86+
<version>4.14.0</version>
8787
<type>pom</type>
8888
<scope>import</scope>
8989
</dependency>

0 commit comments

Comments
 (0)