Azure ML Workspace to connect with SQL Server hosted on a VM

Pravendra Rajput 51 Reputation points
2025-01-24T00:53:46.46+00:00

Connectivity from Azure ML Workspace Notebook to An SQL Server hosted on Virtual Machine in a separate Vnet running data warehouse SQL Server.

The ML workspace has a managed Network.

Is it a possible scenario and how?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,086 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Saideep Anchuri 1,290 Reputation points Microsoft Vendor
    2025-01-24T05:42:45.11+00:00

    Hi Pravendra Rajput

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    you can connect an Azure Machine Learning (ML) workspace to a SQL Server hosted on a Virtual Machine (VM) in a separate Virtual Network (VNet). Given that your ML workspace operates within a managed virtual network, you can utilize this network to set up the connection.

    Here some steps:

    1. Make sure that the managed virtual network for your Azure ML workspace is correctly configured to communicate with the VNet where your SQL Server VM is located. This may require establishing VNet peering between the two VNets.
    2. Consider using a private endpoint for the SQL Server. This enables access to the SQL Server over a private IP address, which enhances security.
    3. Configure the firewall settings on the SQL Server VM to allow traffic from the Azure ML workspace's managed virtual network. You may need to specify the IP ranges or specific subnets.
    4. If the VNets are not peered, you might need to establish a secure connection between the two networks by setting up a VPN gateway or using ExpressRoute.
    5. In your Azure ML workspace notebook, make sure to use the correct connection string to connect to the SQL Server instance, ensuring that it points to the private endpoint if you have it set up.

    Kindly refer below links: how-to-managed-network

    virtual-network-peering

    Thank You.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.