'Azure Premium Function with static outbound IP-address using NAT Gateway not working

We have followed the instuctions in https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-nat-gateway several times without getting it to work (it changes outbound IP-address).

We have:

  1. Created vnet with address 10.10.0.0/16 with subnet delegated to Microsoft.Web/serverFarms (10.10.3.0/24)
  2. Created static IP address
  3. Created NAT Gateway and attached it to the static IP Address and the subnet
  4. Deployed a Azure Premium Function attached to the subnet
  5. Set WEBSITE_VNET_ROUTE_ALL=1 on function
  6. Invoked test-endpoint looking up functions outbound IP using GET whatsmyip.org
  7. Recreating Subnet and reattached the function several times

All resources are setup in region "West Europe". Does anyone have a clue or insights on why this should not work?



Solution 1:[1]

Kind of embarrassing - but it turned out that one should not use whatsmyip.org from scripts/bots - since it then returns bogus ip-addresses. Using https://ifconfig.me showed that this worked all the time.

Thanks to Matt Douhan for pointing me in the right direction by verifing that the NAT Gateway actually got the traffic

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Markus Foss