Search code examples
azureazure-web-app-servicevnetoutbound

Any reason Azure App Service Outbound IP showing IPV6 when integrated with vNET?


I am using Azure App Service with P1V3 App Services Plan so that I can make use of Private Endpoint and vNET integration. vNET integration is configured on a subnet with NAT Gateway attached.

When my application calls outbound, my goal is to control the outbound IP and my expectation is, it should show the NAT ip as outbound ip. But, it does not! Here is my sample code-

enter image description here

App (.Net Core 3.1) is deployed in app service and I see IPV6 as outbound ip? Any idea why I am not seeing IPV4 (NAT ip)? You can see the result by accessing this url- https://whois.aspnet4you.com/api/values/getclientipv2

This is the network configuration at the moment- enter image description here

Subnet looks like-

enter image description here

Outgoing ip showing here-

enter image description here


Solution

  • I want to give credit to Sakaldeep Yadav for his blog post- https://www.linkedin.com/pulse/integrate-azure-web-app-nat-gateway-vnet-get-static-outbound-yadav/

    Here is what I did to solve the issue- Add vNET Integration to app service as you do normally.

    Removed all the services from Endpoint Service section at the Subnet. This was the culprit! If you add services to endpoint service specially Microsoft.Web, traffic is routed through Azure backbone and as RithwikBojja-MT explained you get to see ipv6 as outbound address.

    This is how your subnet should look like- you don't manually add subnet delegation, it is added when you add the subnet to app service vNet integration. Now I can see NAT ip as outbound ip. Try it- https://whois.aspnet4you.com/api/values/getclientipv2

    enter image description here