Hello,
Welcome to Microsoft Q&A,
The clientIp_s
field in Application Gateway WAF logs reflects the immediate source IP of the request, which, in your case, is Azure Front Door. This is expected behavior, as App Gateway treats AFD as the request initiator.
So instead of the original end-user IP, you’re seeing the IP addresses of Azure Front Door edge nodes.
Azure Front Door preserves the original client IP in the X-Forwarded-For
header. This header contains a comma-separated list of IPs where the first IP is the client’s original IP.
However, Application Gateway WAF cannot parse or act on headers like X-Forwarded-For
. This limits your ability to apply custom WAF rules based on the real client IP at the AppGW level.
You can,
- Use Azure Front Door WAF. Move your IP restriction logic to AFD WAF, which can evaluate the real client IP (RemoteAddr) and take action directly at the edge before the request hits AppGW. Configure AFD WAF rules here.
- Log and enforce in your backend application If you control the backend (e.g., App Service or VM), extract the client IP from
X-Forwarded-For
in your app code and implement rate-limiting or blacklisting as needed.
Please Upvote and accept the answer if it helps!!