Azure Storage showing incoming IP as subnet IP instead of NAT Public IP

Mike M 20 Reputation points
2023-11-22T22:02:58.7166667+00:00

I have two completely separate tenants/subscriptions.

  1. Tenant A has a Web App, within a VNET in 10.0.50.0/24 and renders details about table storage.
  2. 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:

  1. Tenant A
    1. 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.
      1. I configure the web app gateway integration to 'route all'
        1. I validate NAT Gateway is using the new PIP via console and ipify (all checks out!)
  2. Tenant B
    1. I swap storage from 'All Networks' to 'Selected Networks'
      1. 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!

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,742 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,197 questions
Azure NAT Gateway
Azure NAT Gateway
NAT Gateway is a fully managed service that securely routes internet traffic from a private virtual network with enterprise-grade performance and low latency.
24 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 36,396 Reputation points Microsoft Employee
    2023-11-27T15:51:57.1866667+00:00

    @Mike M

    Greetings.

    This should be an expected behavior, see : Grant access from a virtual network.

    User's image

    However, this shouldn't be an issue as long as you can request TenantB Storage Account to add the VNET/Subnet from TenantA.

    This in fact provides an increased security as Traffic always stays in the MS backbone, even the ones between TenantA and TenantB.

    Hope this helps.

    Cheers,

    Kapil

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful