@Jacky Lam In Azure Spring Apps, each container has its own instance of the Service Registry (Eureka Server). Therefore, the applications running in different containers cannot discover each other by default.
To make all of your applications register to the same Service Registry, you can configure them to use a shared Eureka Server instance. Here are the steps to do so:
- Create a new Azure Spring Apps instance with the Enterprise tier.
- Deploy a new instance of the Service Registry (Eureka Server) to the new Azure Spring Apps instance.
- Configure your applications to use the new Eureka Server instance by setting the
eureka.client.service-url.defaultZone
property to the URL of the Eureka Server instance. For example:
<span class=" active-doc-0" data-doc-items="0">eureka.client.service-url.defaultZone=https[1](#doc-pos=0)</span>://<eureka-server-name>.<azure-region>.azuremicroservices.io/eureka/
Replace <eureka-server-name>
with the name of the Eureka Server instance and <azure-region>
with the Azure region where the instance is deployed.
You can set this property in the application.properties
or application.yml
file of your Spring Boot application.
After you complete these steps, all of your applications will register to the same Eureka Server instance and be able to discover each other across different containers.