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
1.Open the **Azure portal** and navigate to your AppConfiguration resource associated with your application. Select**ConfigurationExplorer** under **Operations** and create a new key-value pair by selecting **+ Create** > **Key-value** to add the following parameters:
78
-
79
-
| Key | Value |
80
-
|---|---|
81
-
| sentinel | 1 |
82
-
83
-
Leave **Label** and **Content Type** empty for now.
84
-
85
-
1. Select **Apply**.
86
-
87
77
1.Build your SpringBoot application with Maven and run it.
88
78
89
79
```shell
@@ -105,12 +95,6 @@ App Configuration exposes `AppConfigurationRefresh`, which checks if the refresh
105
95
|---|---|
106
96
|/application/config.message |Hello-Updated|
107
97
108
-
1. Update the sentinel key you created earlier to a new value. This change triggers the application to refresh all configuration keys once the refresh interval is passed.
109
-
110
-
| Key | Value |
111
-
|---|---|
112
-
| sentinel | 2 |
113
-
114
98
1.Refresh the browser page twice to see the new message displayed. The first time triggers the refresh, the second loads the changes.
115
99
116
100
> [!NOTE]
@@ -126,28 +110,16 @@ Then, open the *pom.xml* file in a text editor and add a `<dependency>` for `spr
1. Open the **Azure portal** and navigate to your App Configuration resource associated with your application. Select **Configuration Explorer** under **Operations** and create a new key-value pair by selecting **+ Create** > **Key-value** to add the following parameters:
142
-
143
-
| Key | Value |
144
-
|---|---|
145
-
| sentinel | 1 |
146
-
147
-
Leave **Label** and **Content Type** empty for now.
148
-
149
-
1. Select **Apply**.
150
-
151
123
1. Build your Spring Boot application with Maven and run it.
152
124
153
125
```shell
@@ -169,12 +141,6 @@ Then, open the *pom.xml* file in a text editor and add a `<dependency>` for `spr
169
141
|---|---|
170
142
| /application/config.message | Hello - Updated |
171
143
172
-
1. Update the sentinel key you created earlier to a new value. This change triggers the application to refresh all configuration keys once the refresh interval is passed.
173
-
174
-
| Key | Value |
175
-
|---|---|
176
-
| sentinel | 2 |
177
-
178
144
1. Refresh the browser page twice to see the new message displayed. The first time triggers the refresh, the second loads the changes, as the first request returns using the original scope.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-feature-flag-spring-boot.md
+26-71Lines changed: 26 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: mrm9084
5
5
ms.service: azure-app-configuration
6
6
ms.devlang: java
7
7
ms.topic: quickstart
8
-
ms.date: 02/10/2026
8
+
ms.date: 03/16/2026
9
9
ms.author: mametcal
10
10
ms.custom: devx-track-java, mode-other
11
11
#Customer intent: As an Spring Boot developer, I want to use feature flags to control feature availability quickly and confidently.
@@ -21,7 +21,7 @@ The Spring Boot Feature Management libraries extend the framework with comprehen
21
21
22
22
- An Azure account with an active subscription. [Create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
23
23
- An App Configuration store, as shown in the [tutorial for creating a store](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store).
24
-
- A supported [Java Development Kit SDK](/java/azure/jdk) with version 11.
24
+
- A supported [Java Development Kit SDK](/java/azure/jdk) with version 17.
25
25
-[Apache Maven](https://maven.apache.org/download.cgi) version 3.0 or above.
26
26
27
27
## Add a feature flag
@@ -40,7 +40,7 @@ To create a new Spring Boot project:
40
40
1. Specify the following options:
41
41
42
42
* Generate a **Maven** project with **Java**.
43
-
* Specify a **Spring Boot** version that's equal to or greater than 2.0.
43
+
* Specify a **Spring Boot** version that's equal to or greater than 3.0.
44
44
* Specify the **Group** and **Artifact** names for your application. This article uses `com.example` and `demo`.
45
45
* Add the **Spring Web** dependency.
46
46
@@ -71,7 +71,7 @@ To create a new Spring Boot project:
@@ -84,7 +84,7 @@ To create a new Spring Boot project:
84
84
85
85
## Connect to an App Configuration store
86
86
87
-
1. Navigate to the `resources` directory of your app and open the `bootstrap.properties` or `bootstrap.yaml` file. If the file doesn't exist, create it.
87
+
1. Navigate to the `resources` directory of your app and open the `application.properties` or `application.yaml` file. If the file doesn't exist, create it.
88
88
89
89
You can connect to your App Configuration store using Microsoft Entra ID (recommended), or a connection string.
90
90
@@ -94,7 +94,7 @@ To create a new Spring Boot project:
94
94
If you're using a properties file, use the following code:
@@ -107,60 +107,18 @@ To create a new Spring Boot project:
107
107
azure:
108
108
appconfiguration:
109
109
stores:
110
-
-
110
+
- endpoint: ${AZURE_APPCONFIG_ENDPOINT}
111
111
feature-flags:
112
-
enabled: true
113
-
endpoint: ${APP_CONFIGURATION_ENDPOINT}
112
+
enabled: true
114
113
```
115
114
116
115
You use the `DefaultAzureCredential` to authenticate to your App Configuration store. Follow the [instructions](./concept-enable-rbac.md#authentication-with-token-credentials) to assign your credential the **App Configuration Data Reader** role. Be sure to allow sufficient time for the permission to propagate before running your application.
117
116
118
-
1. Add the following code to your project, unless you want to use Managed Identity. Create a new file named `AppConfigCredential.java`:
1. Add configuration Bootstrap Configuration, by creating `spring.factories` file under `resources/META-INF` directory and add the following lines and updating `com.example.MyConfiguration` with your application package:
1. Create a new folder named CSS under `static` and inside of it a new CSS file named *main.css*.
@@ -301,46 +256,46 @@ To create a new Spring Boot project:
301
256
1. Set an environment variable.
302
257
303
258
### [Microsoft Entra ID (recommended)](#tab/entra-id)
304
-
Set the environment variable named **APP_CONFIGURATION_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
259
+
Set the environment variable named **AZURE_APPCONFIG_ENDPOINT** to the endpoint of your App Configuration store found under the *Overview* of your store in the Azure portal.
305
260
306
261
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
Set the environment variable named **APP_CONFIGURATION_CONNECTION_STRING** to the read-only connection string of your App Configuration store found under *Access settings* of your store in the Azure portal.
281
+
Set the environment variable named **APP_CONFIG_CONNECTION_STRING** to the read-only connection string of your App Configuration store found under *Access settings* of your store in the Azure portal.
327
282
328
283
If you use the Windows command prompt, run the following command and restart the command prompt to allow the change to take effect:
0 commit comments