External Data Source from Az SQL DB to Az VM with SQL Server

Matt Brooks 1 Reputation point
2023-08-15T11:14:31.44+00:00
Hi,

Is it possible to create an external data source connection from an Azure SQL Database to SQL server running on an Azure VM.

I've created the connection to external server (Azure VM) which creates but when I try to query it, it fails
CREATE EXTERNAL DATA SOURCE ServerName
		WITH
		(
			TYPE=RDBMS,                             
			LOCATION='ServerName',
			DATABASE_NAME='DatabaseName',
			CREDENTIAL=Credential
		);

Msg 46832, Level 16, State 3, Procedure sp_execute_remote, Line 1 [Batch Start Line 0]
An error occurred while establishing connection to remote data source: [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired[Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

I can connect to the SQL Instance on the Azure VM from my laptop via SSMS, so remote connections are enabled.
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2023-08-15T13:23:06.59+00:00

    It is not supported. Elastic database queries (the creation of external data sources) work between Azure SQL Databases only.

    Please consider replicating the tables you need from Azure SQL to SQL Server using Azure SQL Data Sync.


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.