Looks like VNet integration for Azure SQL Server breaks as soon as the VNet is connected to a private DNS service and that SQL Server has a private endpoint in a different VNet.
The problem starts appearing under following conditions:
- App Service and SQL Server connect via VNet integration
- SQL Server is exposed via private endpoint in some other Vnet
- A private DNS is deployed on the VNet to provide connection to another SQL Server
Consider the following deployment:
Here two copies of the app are deployed in separate regions. They are able to connect to SQL Servers in their regions via VNet integration. Also app-service-2 is able to connect to sql-server-1 (cross-region) via private endpoint. That connection requires private DNS deployment to vnet-2. At this point it all works fine.
Now let's add another private endpoint to allow app-service-1 connection to sql-server-2:
What I observe at this point is that both SQL Servers become unresolvable by DNS in their corresponding VNets. They are still available via private endpoints cross-region, as well as via internet. Only inside a VNet that has some private DNS configured SQL Servers become unresolvable other than with their private DNS.
I have not found any mentions of that behavior in the documentation. Also the portal shows SQL Server as available via VNet integration, despite the situation being opposite.
- Is that some bug in Azure or am I missing something important here?
- Can I make SQL Servers available to apps in the same region, other than via another private endpoint?
Edit:
Here are some more scenarios of DNS resolution failures and successes:
- DNS resolution for SQL Server with a private endpoint still works from the internet.
- DNS resolution for SQL Server with a private endpoint still works from a VNet that doesn't have Private DNS deployed (same as on the first picture)
- DNS resolution for SQL Server with a private endpoint fails from a VNet that has Private DNS attached, regardless of private endpoints in that VNet.
DNS resolution for SQL Server without a private endpoint works fine from everywhere.