Blog Post

Apps on Azure Blog
4 MIN READ

Troubleshooting guide for Application Configuration Service on Azure Spring Apps

Xiaoyun_Ding's avatar
Xiaoyun_Ding
Icon for Microsoft rankMicrosoft
Sep 05, 2023

Application Configuration Service overview

Application Configuration Service for VMware Tanzu (ACS) is one of the commercial VMware Tanzu components. It enables the management of Kubernetes-native ConfigMap resources that are populated from properties defined in one or more Git repositories.

 

Application Configuration Service is offered in two versions: Gen1 and Gen2. The Gen1 version mainly serves existing customers for backward compatibility purposes and is supported only until April 30, 2024. New service instances should use Gen2. The Gen2 version uses flux as the backend to communicate with Git repositories and provides better performance compared to Gen1.

 

You can check the generation information via Azure Portal

 

The below article will introduce the troubleshooting guide for both generations.

 

Case 1: Application fails to start due to configuration not available

1. Make sure your Application Configuration Service setting is correct.

There are several checkpoints in the Application Configuration Service settings. 

  • The Git URI and label are correct. E.g. we have met several cases that use `master` branch but the default branch in GitHub has been changed to `main`.
  • The credentials are correct. If you are using a private Git repo, it is recommended to use `SSH` auth for security considerations. `HTTP basic` auth also works but be cautioned that the token usually has an expiration date. Please remember to update the token before it expires. Please check Authentication section in our docs.

To verify the above things, you may take a look at Application Configuration Service's logs through Azure Log analysis. The log will hint reason if it is not able to access to your Git repository. 

 

// Both works for Application Configuration Service Gen1 and Gen2
AppPlatformSystemLogs 
| where LogType == "ApplicationConfigurationService"
| project TimeGenerated , ServiceName , Log , _ResourceId 
| limit 100

 

If you are using Application Configuration Service Gen2, it is also worth a while to take a look at `Flux` logs.

 

// Only available in Application Configuration Service Gen2
AppPlatformSystemLogs 
| where LogType == "Flux"
| project TimeGenerated , ServiceName , Log , _ResourceId 
| limit 100

 

 

2. Make sure the app is bonded to ACS.

To explicitly use Application Configuration Service feature in an app, you have to bind the app through Azure Portal or Azure command line. It is unbound by default.

 

# Azure Command line to bind app
az spring application-configuration-service bind --app <app-name>

 

3. Make sure the deployment is configured with the corrected pattern.

A pattern is a combination of {application}/{profile}. To explicitly tell Azure Spring Apps which pattern your deployment wants to use, you can do that through Azure Portal or Azure command line.

 

// Bind config file pattern to your deployment
az spring app deploy \
    --name <app-name> \
    --artifact-path <path-to-your-JAR-file> \
    --config-file-pattern <config-file-pattern>

 

4. Restart the app

You have to restart the application after the bind operation. Note that restart is not mandatory if you do an app deploy instead.

 

Case 2: Configuration not refreshed in application

The refresh strategies provides some code examples about the end to end workflow to refresh your Java Spring Boot application configuration after you update the configuration file in the Git repository. The refresh frequency is 60 seconds in Azure Spring Apps but please allow another 60 seconds to reflect the change to the configmap.

If you still hit any issue, you can also follow the below troubleshooting guide.

1. Make sure the Application Configuration Service setting still uses the correct credentials.

Credentials may be expired and not been updated in Application Configuration Service settings. You can verify it through the same step in Case 1 via logs in Azure Log analysis.

 

2. Restart the app

Another possible reason that the refresh doesn't work in your app is that the Spring context is not refreshed. It could be a code issue in the app. You may restart the app to check the result.

 

Hope the troubleshooting guide is helpful to you!

 

To help you get started, we have monthly FREE grants on all tiers – 50 vCPU Hours and 100 memory GB Hours per tier. 

 

Additional Resources 

 

To learn more about Spring Cloud Azure, we invite you to visit the following links: 

 

Updated Sep 04, 2023
Version 1.0
No CommentsBe the first to comment

Share