How to connect to on-premise SQL Server database from Azure Synapse Pyspark notebook ?

Prashant Panaskar 25 Reputation points
2023-11-30T19:03:04.51+00:00

I want to query on-premise SQL server tables from Azure Synpase notebooks. Can I do this? Please give detailed jdbc/pyodbc code.
As per MS community answers till 2021 this was not possible but posting this questions again in case Microsoft has added any way to do this

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2023-12-01T05:20:49.8633333+00:00

    @Anonymous - Thanks for the question and using MS Q&A platform.

    Yes, you can connect to on-premise SQL Server database from Azure Synapse Pyspark notebook.

    For more details, checkout the SO thread addressing similar issue: Fetching data from On-Premise Sql Server to Azure Synapse Notebook using Linked Service.

    If your data store is located inside an on-premises network, an Azure virtual network, or Amazon Virtual Private Cloud, you need to configure a self-hosted integration runtime to connect to it.

    192283-image.png

    For more details, refer to Copy data from a SQL Server database to Azure Blob storage by using the Copy Data tool.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


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.