Hello @Nitin Pandey ,
Welcome to the MS Q&A platform.
Please correct me if my understanding is wrong. When you configure your SQL on Azure VM, you have selected the SQL connectivity as Private(within Vnet). Meaning, you have restricted the SQL connection over the internet. And You want to know how to connect Synapse to your SQL on VM.
Public Connect to SQL Server over the internet.
Private Connect to SQL Server in the same virtual network.
Since you have configured the SQL server within the Vnet, please follow the below to connect synapse to your SQL on VM
1) Your SQL VM and Synapse need to be in the same Vnet. If they are not in the same Vnet, you can create a Vnet peering connection to link these two Vnets.
2) When you choose Private for the SQL connectivity type in the portal, Azure configures most of the settings identical to Public. The one difference is that there is no network security group rule to allow outside traffic on the SQL Server port (default 1433). So you will need to create an Azure firewall rule to allow inbound connections to the SQL Server instance.
Once you configure this, then you can use %sql magic command in the notebook to connect to SQL server on the Azure VM.
Reference document: https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/ways-to-connect-to-sql?view=azuresql
I hope this helps. Please let me know if you have any further questions.
- Please don't forget to click on
and upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators