Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Madhusudan_P
Frequent Visitor

How to access Fabric Warehouse from Fabric Notebooks?

Hi,

I am trying to access Fabric Datawarehouse table from Fabric notebooks. I am copying ABFS path of Datawarehouse table from its properties as under the hood table in datawarehouse is a delta table.

Madhusudan_P_1-1705922147764.png

 

And then passed below query - 

 

df = spark.read.format("delta").load("abfss://My workspace@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")
 
It's getting failed with the following error - 
IllegalArgumentException: Illegal character in authority at index 8: abfss://My workspace@onelake.dfs.fabric.microsoft.com.
 
I tried passing below query but again same error.
df = spark.read.format("delta").load("abfss://My%20workspace@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")

 

Just wondering is it possible to read and write to warehouse tables from notebooks in Fabric?
We have similar option in Synapse in which we can read/write data warehouse tables using .synapsesql option using Notebooks.

https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/writing-data-using-azure-synapse...

1 ACCEPTED SOLUTION

Hi @AndyDDC ,

Thanks for your answer. However, I was curious to try the query said above without any space in the workspace name. For that, I had to create new Fabric account as I don't have new workspace creation request in existing account. It took me a while, but I am able to read DW table from Spark notebook.

df = spark.read.format("delta").load("abfss://workspace-without-space@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")

df.write is getting failed as it says PUT request forbidden.

 

However, It seems like overwrite or create new table in Warehouse using Spark Notebook is not possible as of now. Pyodbc and jdbc might help.

View solution in original post

6 REPLIES 6
govindarajan_d
Solution Supplier
Solution Supplier

Hi @Madhusudan_P,

 

You can add the Warehouse as a shortcut to Lakehouse and then read it just as a table. But even in this method, you will be able to only read data from Warehouse and not write.

 

The approach I would suggest you is add the Lakehouse back in Warehouse and you would be able to query the data from Lakehouse within Warehouse. Kind of like a full circle. 

 

AndyDDC
Most Valuable Professional
Most Valuable Professional

You won't be able to read or write to Warehouse tables as those requests need to go through the SQL endpoint of the warehouse, it won't work with Spark.

 

You can use something like pyodbc or jdbc to connect to the Warehouse from within a notebook:

 

https://learn.microsoft.com/en-us/fabric/data-warehouse/connectivity

 

 

Hi @AndyDDC ,

Thanks for your answer. However, I was curious to try the query said above without any space in the workspace name. For that, I had to create new Fabric account as I don't have new workspace creation request in existing account. It took me a while, but I am able to read DW table from Spark notebook.

df = spark.read.format("delta").load("abfss://workspace-without-space@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")

df.write is getting failed as it says PUT request forbidden.

 

However, It seems like overwrite or create new table in Warehouse using Spark Notebook is not possible as of now. Pyodbc and jdbc might help.

Hi @Madhusudan_P 
That's correct, you cannot write directly to the warehouse folder. All updates have to come through the warehouse engine. You can't write to DW tables from Spark or any other engine .

Hi @v-nikhilan-msft 
Since we have the capacity in Synapse Dedicated SQL Pool to write from Synapse notebook, why this hasn't been extended to Fabric Warehouse and Notebooks. Is it expected in future?
Dedicated SQL Pool connector for Apache Spark

Hi @Madhusudan_P 
Currently we do not have any information regarding the availability of this feature. 

Appreciate if you could share the feedback on our feedback channel. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

 

Hope this helps. Please let me know if you have any further queries.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.