79291017

Date: 2024-12-18 12:09:13
Score: 1
Natty:
Report link

Hi Please use below steps.

First you need to Configure the Azure VPN Client

Then :

Navigate to "Firewalls and virtual networks" of you SQL server and make sure to set "Deny public network access" to yes.

Create an Azure private endpoint. It will create endpoint for SQL server within your virtual network and it'll be assigned a private IP from within subnet's IP range. You will use this private IP to connect to SQL server. On your local machine, make sure you're connected to VPN and open SQL Server Management Studio:

Under "Server name" enter private IP address of Azure private endpoint created in step 2.

Under "Login" field, enter username in format "username@public_sql_server_name" (e.g. [email protected]). For password, just enter your password.

Last thing to do is to click on "Options" and navigate to "Connection properties". Make sure to check "Encrypt connection" and "Trust server certificate".

This is required as server's certificate is issued to "my-sql-server.database.windows.net" and you're accessing it via private IP. If this wasn't checked, management studio wouldn't trust server's certificate and would refuse connection.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Nishant Tyagi