How can I query on-premise SQL server database from Azure SQL database?

Anirud Thapliyal 96 Reputation points
2021-02-25T16:30:42.637+00:00

We have an existing on-premise SQL server database. We are trying to build a ASP.NET core web app and deploy on Azure as App Service. Along with it we will also have a new Azure SQL database singleton.

How can I query our on-premise SQL server database table from Azure SQL database through a stored procedure?
Should we use Azure SQL managed instance instead of Azure SQL database singleton for this?

Thanks In Advance!

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,791 questions
0 comments No comments
{count} vote

Accepted answer
  1. Nandan Hegde 29,896 Reputation points MVP
    2021-02-25T16:41:09.95+00:00

    Hey @Anirud Thapliyal ,
    Is is not possible to directly query an On prem table in Azure SQL database but vice versa is possible.

    Azure SQL database doesn't support the linked server property so you wont be able to access on prem tables in Azure SQL database and the elastic query in Azure SQL database is to query tables between 2 Azure SQL databases and not On prem.

    But the vice versa of querying the Azure SQL database table in On prem is possible via the concept of linked server .

    In case if you want the on prem table in Azure SQL, you can either use the concept of data sync to sync data between on prem and cloud or you can use Azure data factory to copy from on prem to Azure SQL.

    But unfortunately based on my understanding as of now, it is not directly possible to have your requirement

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful