How to get the client IP using a Symfony 4 application hosted on Azure Web App

  azure-web-sites, php, symfony, symfony4

I want to log every login attempts on a Web App (Symfony 4.1) hosted on Azure.

Based on this question, to get the client IP, I’m using :

// $requestStack being SymfonyComponentHttpFoundationRequestStack
$ip = $this->requestStack->getMasterRequest()->getClientIp();

However, the logs tell :

[2020-03-10 10:55:56] login_attempt.INFO: User ‘username’ successfully logged in from ip ‘’ [] []

As you can notice, this is a private IP. I tried to log in from differents connections, but I’m always getting that IP, Where does this IP come from and how to get the real public IP of the client ?

Source: Symfony Questions