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

557 Views Asked by At

We have followed the instuctions in https://learn.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?

1

There are 1 best solutions below

0
On

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