Hi Khaleel Shaik,
In addition to Luke Murray response,
we recommend replacing the NAT Gateway with a lightweight Linux VM acting as a NAT instance. This setup uses VNet Integration, a User Defined Route (UDR), and standard Linux NAT capabilities. while maintaining control over outbound IPs from Azure App Services
Do follow configure-virtual-machine-software
- Enable VNet Integration
In the App Service, go to Networking → VNet Integration
Integrate with a VNet and select a dedicated subnet
- Provision the NAT VM
Create a Linux VM (Ubuntu/Debian recommended) in the same VNet or a peered VNet
Assign a Standard SKU Static Public IP
- Enable IP forwarding: example in the document above enable-ip-forwarding-in-the-operating-system
-
- Configure NAT with iptables
- Create a User Defined Route (UDR)
- Create a route table and a route for all traffic:
az network route-table create \
--resource-group test-rg \
--name route-table-nat-hub \
--location eastus2
Associate the route table with the subnet used by VNet Integration
- Update NSG Rules (if any)
- Ensure that traffic is allowed:
- From App Service subnet → NAT VM (private IP)
- From NAT VM → Internet
- From Internet → NAT VM (optional, for testing/monitoring)
- we can test it by Deploy an endpoint in the App Service that calls: test-nat-gateway-from-spoke-one
https://whatsmyip.com
This should return the static public IP of the NAT VM, confirming that traffic is routing correctly.
If you have any further assistant, do let me know.