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/spring-apps/enterprise/how-to-enterprise-application-configuration-service.md
+53-55Lines changed: 53 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Use Application Configuration Service for Tanzu with the Azure Spring Apps Enterprise plan
2
+
title: Use Application Configuration Service for Tanzu
3
3
titleSuffix: Azure Spring Apps Enterprise plan
4
4
description: Learn how to use Application Configuration Service for Tanzu with the Azure Spring Apps Enterprise plan.
5
5
author: KarlErickson
@@ -51,19 +51,19 @@ You can choose the version of Application Configuration Service when you create
51
51
52
52
Application Configuration Service supports Azure DevOps, GitHub, GitLab, and Bitbucket for storing your configuration files.
53
53
54
-
To manage the service settings, open the **Settings** section. Configure the following three key aspects:
54
+
To manage the service settings, open the **Settings** section. In this section, you can configure the following key aspects:
55
55
56
56
-**Generation**: Upgrade the service generation.
57
57
-**Refresh Interval**: Adjust the frequency at which the service checks for updates from Git repositories.
58
-
-**Repositories**: Add new entries, or modify existing ones. This function allows you to control which repositories the service monitors use to pull data.
58
+
-**Repositories**: Add new entries, or modify existing ones. This function enables you to control which repositories the service monitors use to pull data.
59
59
60
60
:::image type="content" source="media/how-to-enterprise-application-configuration-service/configuration-service-settings.png" alt-text="Screenshot of the Azure portal that shows the Application Configuration Service page with the Settings tab highlighted." lightbox="media/how-to-enterprise-application-configuration-service/configuration-service-settings.png":::
61
61
62
-
If your current service generation is **Gen1**, you can upgrade to **Gen2** for better performance. For more information, see the [Upgrade from Gen1 to Gen2](#upgrade-from-gen1-to-gen2) section in this article.
62
+
If your current service generation is **Gen1**, you can upgrade to **Gen2** for better performance. For more information, see the [Upgrade from Gen1 to Gen2](#upgrade-from-gen1-to-gen2) section.
63
63
64
-
The **Refresh Interval** specifies the frequency (in seconds) for checking updates in the repository. The minimum value is *0*, which disables automatic refresh. For optimal performance, set this interval at a minimum of 60 seconds.
64
+
The **Refresh Interval** specifies the frequency (in seconds) for checking updates in the repository. The minimum value is *0*, which disables automatic refresh. For optimal performance, set this interval to a minimum value of 60 seconds.
65
65
66
-
The following table describes the properties for each repository entry.
66
+
The following table describes the properties for each repository entry:
@@ -78,7 +78,7 @@ The following table describes the properties for each repository entry.
78
78
Configuration is pulled from Git backends using what you define in a pattern. A pattern is a combination of *{application}/{profile}* as described in the following guidelines.
79
79
80
80
-*{application}* - The name of an application whose configuration you're retrieving. The value `application` is considered the default application and includes configuration information shared across multiple applications. Any other value refers to a specific application and includes properties for both the specific application and shared properties for the default application.
81
-
-*{profile}* - Optional. The name of a profile whose properties you could retrieve. An empty value, or the value `default`, includes properties that are shared across profiles. Non-default values include properties for the specified profile and properties for the default profile.
81
+
-*{profile}* - Optional. The name of a profile whose properties you can retrieve. An empty value, or the value `default`, includes properties that are shared across profiles. Non-default values include properties for the specified profile and properties for the default profile.
82
82
83
83
### Authentication
84
84
@@ -142,7 +142,7 @@ Use the following steps to upgrade from Gen1 to Gen2:
142
142
143
143
1. Select **Validate** to validate access to the target URI. After validation completes successfully, select **Apply** to update the configuration settings.
144
144
145
-
:::image type="content" source="media/how-to-enterprise-application-configuration-service/configuration-server-upgrade-gen2-settings.png" alt-text="Screenshot of the Azure portal that shows the Application Configuration Service page with the Settings tab showing and the Validate button highlighted." lightbox="media/how-to-enterprise-application-configuration-service/configuration-server-upgrade-gen2-settings.png":::
145
+
:::image type="content" source="media/how-to-enterprise-application-configuration-service/configuration-server-upgrade-gen2-settings.png" alt-text="Screenshot of the Azure portal that shows the Application Configuration Service page and the Settings tab with the Validate button highlighted." lightbox="media/how-to-enterprise-application-configuration-service/configuration-server-upgrade-gen2-settings.png":::
146
146
147
147
## Polyglot support
148
148
@@ -152,58 +152,58 @@ The Application Configuration Service also supports polyglot apps like dotNET, G
152
152
153
153
## Refresh strategies
154
154
155
-
When you modify and commit your configurations in a Git repository, several steps are involved before these changes are reflected in your applications, as mentioned in the following diagram:
155
+
When you modify and commit your configurations in a Git repository, several steps are involved before these changes are reflected in your applications. This process, though automated, involves the following distinct stages and components, each with its own timing and behavior:
156
156
157
-
:::image type="content" source="media/how-to-enterprise-application-configuration-service/acs-refresh-lifecycle.png" alt-text="Diagram that shows the lifecycle of the refresh process of Application Configuration Service." lightbox="media/how-to-enterprise-application-configuration-service/acs-refresh-lifecycle.png":::
157
+
- Polling by Application Configuration Service: The Application Configuration Service regularly polls the backend Git repositories to detect any changes. This polling occurs at a set frequency, defined by the refresh interval. When a change is detected, Application Configuration Service updates the Kubernetes `ConfigMap`.
158
+
- ConfigMap update and interaction with kubelet cache: In Azure Spring Apps, this `ConfigMap` is mounted as a data volume to the relevant application. However, there's a natural delay in this process due to the frequency at which the kubelet refreshes its cache to recognize changes in `ConfigMap`.
159
+
- Application reads updated configuration: Your application running in the Azure Spring Apps environment can access the updated configuration values. The existing beans in the Spring Context aren't automatically refreshed to use the updated configurations.
158
160
159
-
This process, though automated, involves the following distinct stages and components, each with its own timing and behavior.
161
+
These stages are summarized in the following diagram:
160
162
161
-
-**Polling by Application Configuration Service**: The Application Configuration Service regularly polls the backend Git repositories to detect any changes. This polling occurs at a set frequency, defined by the refresh interval. When a change is detected, Application Configuration Service updates the Kubernetes `ConfigMap`.
162
-
-**ConfigMap Update and Interaction with Kubelet Cache**: In Azure Spring Apps, this `ConfigMap` is mounted as a data volume to the relevant application. However, there's a natural delay in this process due to the frequency at which the Kubelet refreshes its cache to recognize changes in `ConfigMap`.
163
-
-**Application Reads Updated Configuration**: Application running in the Azure Spring Apps environment can access the updated configuration values. The existing beans in the Spring Context aren't refreshed to use the updated configurations automatically.
163
+
:::image type="content" source="media/how-to-enterprise-application-configuration-service/acs-refresh-lifecycle.png" alt-text="Diagram that shows the lifecycle of the refresh process of Application Configuration Service." lightbox="media/how-to-enterprise-application-configuration-service/acs-refresh-lifecycle.png":::
164
164
165
165
You can adjust the polling refresh interval of the Application Configuration Service to align with your specific needs. To apply the updated configurations in your application, a restart or refresh action is necessary.
166
166
167
-
In Spring applications, properties are hold or referenced as the beans within the Spring Context. To load new configurations, use the following methods:
167
+
In Spring applications, properties are held or referenced as beans within the Spring Context. To load new configurations, consider using the following methods:
168
168
169
169
- Restart the application. Restarting the application always loads the new configuration.
170
170
171
171
- Call the `/actuator/refresh` endpoint exposed on the config client via the Spring Actuator.
172
172
173
-
To use this method, add the following dependency to your configuration client’s *pom.xml* file.
173
+
To use this method, add the following dependency to your configuration client’s *pom.xml* file.
After you reload the property sources by calling the `/actuator/refresh` endpoint, the attributes bound with `@Value` in the beans having the annotation `@RefreshScope` are refreshed.
188
+
After you reload the property sources by calling the `/actuator/refresh` endpoint, the attributes bound with `@Value` in the beans having the annotation `@RefreshScope` are refreshed.
189
189
190
-
```java
191
-
@Service
192
-
@Getter@Setter
193
-
@RefreshScope
194
-
publicclassMyService {
195
-
@Value
196
-
privateBoolean activated;
197
-
}
198
-
```
190
+
```java
191
+
@Service
192
+
@Getter@Setter
193
+
@RefreshScope
194
+
publicclassMyService {
195
+
@Value
196
+
privateBoolean activated;
197
+
}
198
+
```
199
199
200
-
Use curl with the application endpoint to refresh the new configuration.
200
+
Use curl with the application endpoint to refresh the new configuration, as shown in the following example:
201
201
202
-
```bash
203
-
curl -X POST http://{app-endpoint}/actuator/refresh
204
-
```
202
+
```bash
203
+
curl -X POST http://{app-endpoint}/actuator/refresh
204
+
```
205
205
206
-
- Use `FileSystemWatcher` to watch the file change and refresh the context on demand. `FileSystemWatcher` is a class shipped with `spring-boot-devtools` that watches specific directories for file changes, or you can use another utility with similar function. The previous option requires users to initiate the refresh actively, while the latter can monitor for file changes and automatically invoke the refresh upon detecting updates. The file path, as mentioned in the [Polyglot support](#polyglot-support) section, can be retrieved using the environment variable `AZURE_SPRING_APPS_CONFIG_FILE_PATH`.
206
+
- Use `FileSystemWatcher` to watch the file change and refresh the context on demand. `FileSystemWatcher` is a class shipped with `spring-boot-devtools` that watches specific directories for file changes, or you can use another utility with similar function. The previous option requires users to initiate the refresh actively, while the latter can monitor for file changes and automatically invoke the refresh upon detecting updates. You can retrieve the file path by using the environment variable `AZURE_SPRING_APPS_CONFIG_FILE_PATH`, as mentioned in the [Polyglot support](#polyglot-support) section.
207
207
208
208
## Configure Application Configuration Service settings
209
209
@@ -290,7 +290,7 @@ Use the following steps to use Application Configuration Service with applicatio
290
290
291
291
1. In the navigation pane, select **Configuration** and then select **General settings**.
292
292
293
-
1. In the **Config file patterns** dropdown, choose one or more patterns from the list. For more information, see the [Pattern](#pattern) section in this article.
293
+
1. In the **Config file patterns** dropdown, choose one or more patterns from the list. For more information, see the [Pattern](#pattern) section.
294
294
295
295
:::image type="content" source="media/how-to-enterprise-application-configuration-service/configuration-service-pattern.png" alt-text="Screenshot of the Azure portal that shows the App Configuration page with the General settings tab and api-gateway options highlighted." lightbox="media/how-to-enterprise-application-configuration-service/configuration-service-pattern.png":::
296
296
@@ -426,23 +426,21 @@ To check the logs of `application-configuration-service` and `flux-source-contro
426
426
:::image type="content" source="media/how-to-enterprise-application-configuration-service/query-logs-flux-source-controller.png" alt-text="Screenshot of the Azure portal that shows the query result of logs for flux-source-controller." lightbox="media/how-to-enterprise-application-configuration-service/query-logs-flux-source-controller.png":::
427
427
428
428
> [!NOTE]
429
-
> There could be a few minutes delay before the logs are available in Log Analytics.
429
+
> There might could be a few minutes delay before the logs are available in Log Analytics.
430
430
431
431
## Troubleshoot known issues
432
432
433
-
If the latest changes don't reflect on the applications, check the following items based on the [Refresh Strategies](#refresh-strategies) section:
433
+
If the latest changes aren't reflected in the applications, check the following items based on the [Refresh strategies](#refresh-strategies) section:
434
434
435
-
- Check if Git repo is updated correctly and the application is bound to the Application Configuration Service:
436
-
- The branch of the desired config file changes is updated.
437
-
- The pattern configured in the Application Configuration Service matches the updated config files.
438
-
- The application is bound to the Application Configuration Service.
439
-
- Check whether the `ConfigMap` is updated:
440
-
- `ConfigMap` of the app should be updated. If it isn't updated, raise a ticket.
441
-
- Check whether the `ConfigMap` is mounted to the application as a file:
442
-
- Use `web shell` to check the mounted file. If the file isn't updated, wait for the K8S refresh interval (1 minute). Or, you can force a refresh by restarting the application.
435
+
- Confirm that the Git repo is updated correctly by checking the following items:
436
+
- Confirm that the branch of the desired config file changes is updated.
437
+
- Confirm that the pattern configured in the Application Configuration Service matches the updated config files.
438
+
- Confirm that the application is bound to the Application Configuration Service.
439
+
- Confirm that the `ConfigMap` of the app is updated. If it isn't updated, raise a ticket.
440
+
- Confirm that the `ConfigMap` is mounted to the application as a file by using `web shell`. If the file isn't updated, wait for the Kubernetes refresh interval (1 minute), or force a refresh by restarting the application.
443
441
444
-
Now, the updated configurations should reflect on the applications. If it isn't updated, raise a ticket.
442
+
After checking these items, the applications should be able to read the updated configurations. If the applications still aren't updated, raise a ticket.
0 commit comments