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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
ketankhunti
New Member

How to configure default Lakehouse in notebook in Fabric

I want to configure defualt laekhouse in notebook. i can do it using %%configure command. but i am note able to use variables here to be used in %%configure command. As configure should be the first cell of the notebook and if you put it in middle of the notebook then you have to force restart session, but problem is when i restart session, my variables will be erased.

ketankhunti_0-1734346304815.png

I also tried this, but getting this error

ketankhunti_1-1734346397449.png

How to resolve it. i also tried using mount, but that is also not working

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ketankhunti 

 

The configure magic has to be the first cell and be at the beginning of the first cell, so we can't programmatically assign the lakehouse id or name in the configure json via a variable or config file. This is the main obstacle.

 

Do you must set up the default lakehouse for the notebook? If not, you could try mounting a lakehouse to the notebook. Then you will be able to use the relative File API path to reference the tables and files in the lakehouse. This doesn't specify a default lakehouse. 

 

Another option is to use the ABFS path to reference a lakehouse. With ABFS path, you can always reference tables and files in a lakehouse correctly, without bothering whether it's the default lakehouse. 

 

The third link I listed below introduces a method to update the default lakehouse. I haven't tested that. You may give it a try. You might need to modify the default lakehouse for other notebooks with a new notebook.

 

References:

How to Attach a Default Lakehouse to a Notebook in Fabric

How To Mount A Lakehouse and Identify Mounted Lakehouses in Fabric

Programmatically Removing & Updating Default Lakehouse Of A Fabric Notebook

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ketankhunti 

 

The configure magic has to be the first cell and be at the beginning of the first cell, so we can't programmatically assign the lakehouse id or name in the configure json via a variable or config file. This is the main obstacle.

 

Do you must set up the default lakehouse for the notebook? If not, you could try mounting a lakehouse to the notebook. Then you will be able to use the relative File API path to reference the tables and files in the lakehouse. This doesn't specify a default lakehouse. 

 

Another option is to use the ABFS path to reference a lakehouse. With ABFS path, you can always reference tables and files in a lakehouse correctly, without bothering whether it's the default lakehouse. 

 

The third link I listed below introduces a method to update the default lakehouse. I haven't tested that. You may give it a try. You might need to modify the default lakehouse for other notebooks with a new notebook.

 

References:

How to Attach a Default Lakehouse to a Notebook in Fabric

How To Mount A Lakehouse and Identify Mounted Lakehouses in Fabric

Programmatically Removing & Updating Default Lakehouse Of A Fabric Notebook

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

May FBC25 Carousel

Fabric Monthly Update - May 2025

Check out the May 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.