Unable to connect to Azure SQL through Virtual Network Gateway

1k views Asked by At

I have SQL Azure Database Server (not managed instance). When setup last year, I added Azure Virtual Network Gateway, and I could access the database via the VPN connection, without whitelisting the IP.

We didn't use this connection via gateway since Jan 2020. There was only couple of developers connection but had their IP whitelisted.

Recently, we tried accessing the database using this connection, and it doesn't work. Prompting to whitelist the IP. Has something changed?

SQL Virtual Network setup

1

There are 1 answers

3
Nancy On BEST ANSWER

It seems that you just enable Azure virtual network service endpoints for your Azure SQL database server (not managed instance) and add this subnet to your SQL network rules. With service endpoint, the traffics go over the Internet but restrict over the network. Service endpoints and Private endpoints are two different things.

To connect to your Azure SQL database via a VPN connection, you could use a private link. Private Link allows you to connect to various PaaS services in Azure via a private endpoint. You could get the detailed steps from https://learn.microsoft.com/en-us/azure/azure-sql/database/private-endpoint-overview

Alternatively, you could try to use a TCP proxy server to forward traffic to the public IP address for SQL Database. Reference: https://argonsys.com/microsoft-cloud/library/using-a-tcp-proxy-to-connect-to-sql-database-over-vpn/