Hi Subhash Chand,
let me add a few coins, when traffic passes through Azure Firewall using DNAT, the original source IP is not preserved. The firewall terminates the connection and opens a new one towards the backend. From the VMSS point of view, the client is the firewall or the load balancer, not the real user. This is how layer four NAT works and it is not configurable.
If the protocol is HTTP or HTTPS, the only correct way to preserve the client IP is to move this to layer seven. That means using Application Gateway or Front Door in front of the VMSS. These services forward the real client IP in headers such as X Forwarded For or X Original Client IP, which the application can then log and use for whitelisting.
If Azure Firewall must remain in the perimeter, the practical architecture looks like this. Client to Application Gateway to Azure Firewall to VMSS. The firewall is still used for inspection and control, while Application Gateway handles client IP preservation.
If this is not HTTP but raw TCP or UDP, then there is no solution in this design. Neither Azure Firewall nor Azure Load Balancer can preserve the source IP in this traffic path. In that case you either change the architecture or accept that the backend will never see the real client IP.
Azure Firewall with DNAT always hides the source IP. For web traffic you need a layer seven proxy. For TCP or UDP, preserving the client IP is not possible in this setup.
Rgds,
Alex