I have two completely separate tenants/subscriptions.
- Tenant A has a Web App, within a VNET in 10.0.50.0/24 and renders details about table storage.
- Tenant B has an Azure Storage resource /w Table storage.
I want to connect the Web App to the table storage. Easy enough to grab the connection string. However I want to lock down the storage resource so that only a specific IP can access it. I do the following:
- Tenant A
- I add a NAT Gateway, and standard Public IP as its sole outgoing IP, and associate it to my 10.0.50.0/24 subnet.
- I configure the web app gateway integration to 'route all'
- I validate NAT Gateway is using the new PIP via console and ipify (all checks out!)
- Tenant B
- I swap storage from 'All Networks' to 'Selected Networks'
- I whitelist the PIP used in tenant A.
When complete, Tenant A cannot access the table storage anymore. I added diagnostic logs, and the Tenant B storage doesn't see the public IP, but rather the Tenant A subnet IP (i.e. 10.0.50.253) as the callerIpAddress.
Why is this? Private IP's cannot be whitelisted. Why am I not seeing the public IP?
I've looked into internet routing vs Microsoft routing but from what I read this is unrelated to the issue. Public IPs with internet routing cannot be associated to NAT anyway and table storage doesnt allow for a route specific endpoint anyway.
Thanks!