Forum Discussion
Accessing Fabric Lakehouse data from SQL Server 2016/2022 (Linked Server or Live Query)
- 11 months ago
Hi MJParikh, v-dineshya
I now can successfully create linked server in SQL2016 / 2022 to Fabric Lakehouse using Service Principal Credential, here is my script:EXEC master.dbo.sp_addlinkedserver @server = N'FABRIC', @srvproduct=N'Fabric SQL', @provider=N'MSOLEDBSQL19', @datasrc=N'', @provstr=N'Server=xx.fabric.microsoft.com;Authentication=ActiveDirectoryServicePrincipal' EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'FABRIC', @useself=N'False', @locallogin=NULL, @rmtuser=N'xxxxx', @rmtpassword='xxxxx'
2. make sure 1433 is configured with your SQL server in SQL Server Configuration Managner > SQL Server Network Configuration > Protocols for SQL Server > TCP/IP > IP Addresses > TCP Port > 1433
3. On MSOLEDBSQL19 Provider > Properties > Provider Options > make sure 'Allow inprocess' is checked.Now you should be able to see linkedserver established (screen shot below)
4. To query fabric lakehouse table, should use openquery (see below)
π
Had a quick discussion with Microsoft, and the key takeaways were:
Linked Server connections from on-prem SQL Server 2016/2022 to Fabric Lakehouse are not supported yet.
OPENROWSET queries donβt work in this scenario either.
Setting up External Data Sources and External Tables for Lakehouse access is quite cumbersome, mainly due to the SAS token limitation β it expires after one hour.
As an alternative, we managed to get it working in reverse β by pushing Fabric Lakehouse tables down to SQL Server on demand using a Copy Activity through the Gateway.