fascynacja
fascynacja

Reputation: 2888

Eureka instance hosted as Azure Web app registers itself with wrong ip (ip from within the container)

I have a setup of a Spring Boot apps, which are hosted as Azure Web App. My understanding of all components of Azure Web Apps and their connections is still vague to me, so exucse me if I mistunderstood or missed something.

Apps are:

When the WaterService is registering in the eureka server from within Azure it registers itself with an IP: 169.254.129.3, which I was not finding anywhere in the Web App networking configurations. The eureka home page shows it like: enter image description here

Then I went to the SSH client of the container and did ifconfing: enter image description here

So my understanding is that this is some "inside" Ip from the container. But this IP is useless for discovery service, since it cannot be used in order to connect to it from other Azure Web Apps (potential).

I have tried the solution which I found here: Eureka Client Registered with Container IP in ECS Fargate but the IP is still the same. I have also tried to change different properties of the client service but without any luck.

The client application.properties are as follows:

eureka.client.service-url.defaultZone= https://dev-my-discovery-server.azurewebsites.net:443/eureka/
eureka.instance.prefer-ip-address=true
logging.level.com.netflix.eureka=DEBUG
logging.level.com.netflix.discovery=DEBUG
eureka.instance.hostname=dev-my-waterservice.azurewebsites.net
eureka.instance.securePort=443
eureka.instance.securePortEnabled=true
eureka.instance.nonSecurePortEnabled=false
eureka.instance.secure-port-enabled=true
eureka.instance.nonsecure-port-enabled=false
server.port=443
 
eureka.instance.nonSecurePort=83

Additional info is when I do a nslookup for my the clients domain I am getting a different IP ( I believe this is the IP of the private endpoint which is configured for this app):

kudu_ssh_user@7db625621591:/$ nslookup dev-my-waterservice.azurewebsites.net
Server:         127.0.0.11
Address:        127.0.0.11#53

Non-authoritative answer:
dev-my-waterservice.azurewebsites.net canonical name = dev-my-waterservice.azurewebsites.net
Name:   dev-my-waterservice.azurewebsites.net
Address: 172.24.138.4

How can i configure my eureka client to register itself with the Azure Web app IP which can be used later by other apps in order to connect to it?

Also please note that all those components work perfectly on my local machine.

Upvotes: 0

Views: 104

Answers (0)

Related Questions