Azure Container Apps provides several managed component which could help customers running Spring Boot in production. These include Eureka Server, Config Server, and Spring Boot Admin.
In this module, we'll focus on three key objectives:
- ✅ Create various managed components for Spring Boot applications.
- 📊 Access the Eureka Server dashboard.
- 🔍 Access the Spring Boot Admin dashboard.
One of the fundamental requirement of a cloud-native application is service discovery - the ability to find and identify the different microservices. In this section, we'll create a Spring Cloud Eureka Server to enable this functionality.
- Set the environment variables to define the Eureka Server name.
EUREKA_SERVER_NAME="eurekaserver"
- Create the Managed Eureka Server.
az containerapp env java-component eureka-server-for-spring create \
--environment ${ACA_ENVIRONMENT_NAME} \
--name ${EUREKA_SERVER_NAME} \
--query properties.ingress.fqdn -o tsv
Another fundamental requirement of cloud-native applications is externalized configuration- the ability to store, manage, and version configuration separately from the application code. In this section, we'll create and configure a Spring Cloud Config Server to enable this functionality. In the next section, you'll see how Spring Cloud Config can inject configuration from a Git repository into your application.
To use this shortcut:
- Set the following environment variables to define the Config Server name and the Git repository URL to be used as the configuration source.
CONFIG_SERVER_NAME="configserver" GIT_URL="https://github.com/eggboy/spring-petclinic-microservices-config"
- Create the Managed Config Server for Spring and set its configuration source as the public Git repository.
az containerapp env java-component config-server-for-spring create \ --environment ${ACA_ENVIRONMENT_NAME} \ --name ${CONFIG_SERVER_NAME} \ --configuration spring.cloud.config.server.git.uri=$GIT_URL spring.cloud.config.server.git.refresh-rate=60
The Admin for Spring managed component offers an administrative interface for Spring Boot web applications that expose actuator endpoints. As a managed component in Azure Container Apps, you can easily bind your container app to Admin for Spring for seamless integration and management.
- Set the following environment variables to define the Spring Boot Admin name.
SPRING_ADMIN_NAME="admin"
- Create the Managed Spring Boot Admin.
az containerapp env java-component admin-for-spring create \
--environment ${ACA_ENVIRONMENT_NAME} \
--name ${SPRING_ADMIN_NAME} \
--min-replicas 1 \
--max-replicas 1 \
--query properties.ingress.fqdn -o tsv
- Access Spring Boot Admin console using FQDN returned from the command above. Spring Boot Admin is by default secured by Azure Entra ID.
In this module, we created a managed Eureka Server, Config Server, and Spring Boot Admin. Furthermore, We explored the Eureka Server dashboard and Spring Boot Admin dashboard. Up next, we will deploy the PetClinic microservices.