Elevating @ajkuma's solution from the comments so it can be marked as the accepted answer.
- Create an ApplicationHost.xdt file with the following content:
<?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.webServer> <arrHelper> <trustedProxies xdt:Transform="SetAttributes(trustUnlisted)" trustUnlisted="true" /> </arrHelper> </system.webServer> </configuration>
- Make sure your App Service is configured so that it does not allow direct access in order to avoid X-Forwarded-For spoofing attacks.
- Upload the file to c:\home\site within your App Service.
- Restart the App Service.
- Make a request against your site and verify that the AppServicesHTTPLogs.CIp field contains your IP.