I’ve been trying to get my Spring Boot service running in Azure App Service to use Azure App Configuration service to get configuration parameters. The app service uses a User Assigned Identity. Through a lot of trial and error, I have gotten it to work, but it only works with an old version of the app config package. Also noticed that in the docker logs the MSI container is not starting as expected:
If I use the following dependency in my project, it works:
dependency
groupId com.azure.spring/groupId
artifactId azure-spring-cloud-appconfiguration-config-web
/artifactId
version 2.11.0 /version
/dependency
But it seems that the above version is deprecated in favor of this dependency for Spring Boot (2.x):
I have also tried updating the app to Spring Boot (3.x) with no luck.
If I update the package, the deployment fails on startup with
2023-06-19T15:37:12.539956477Z: [INFO] 2023-06-19 15:37:12.536 DEBUG 296 --- [ main] c.a.identity.ManagedIdentityCredential : Azure Identity => Found the following environment variables: MSI_ENDPOINT, MSI_SECRET, AZURE_TENANT_ID
2023-06-19T15:37:20.230369505Z: [INFO] 2023-06-19 15:37:20.229 ERROR 296 --- [onPool-worker-1] c.a.identity.ManagedIdentityCredential : Azure Identity => ERROR in getToken() call for scopes [https://XXX.azconfig.io/.default]: Managed Identity authentication is not available.
2023-06-19T15:37:20.239206040Z: [INFO] 2023-06-19 15:37:20.238 ERROR 296 --- [onPool-worker-1] c.a.c.implementation.AccessTokenCache : {"az.sdk.message":"Failed to acquire a new access token.","exception":"Managed Identity authentication is not available."}
I’ve been trying to get my Spring Boot service running in Azure App Service to use Azure App Configuration service to get configuration parameters. The app service uses a User Assigned Identity. Through a lot of trial and error, I have gotten it to work, but it only works with an old version of the app config package. Also noticed that in the docker logs the MSI container is not starting as expected:
If I use the following dependency in my project, it works:
But it seems that the above version is deprecated in favor of this dependency for Spring Boot (2.x):
I have also tried updating the app to Spring Boot (3.x) with no luck.
(Note that we are using Spring Boot 2.x because Azure Spring Data Cosmos does not support Spring Boot 3.x at this time (per https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos#spring-boot-version-support). According to this other Spring Version mapping, I should be able to use Spring Cloud Azure version 4.x.x with Spring Boot 2.7.x: https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping#which-version-of-spring-cloud-azure-should-i-use
According to this site, https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-convert-to-the-new-spring-boot?tabs=spring-boot-2 I should be able to run with the 4.8.0 version of Spring Cloud Azure. Can you advise?
I also opened a support case 2306190040007997, but have heard the sdk is primarily supported through github.
pom.xml.txt