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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Creating lakehouse using spark notebook

Hi,

 

We have created a new analytics platform which we mainly used Azure Synapse Analytics. However, recenly we are experimenting with microsoft fabric due to its pre-warmed up spark pools which could reduce our analytics reload time. Considering on migrating to fabric from synapse, I had some question regarding creating lakehouses.

In our current solution we are following medallion architecture. Data is coming through our bronze zones with simple copy activities.
In silver zone, we are utilizing spark to do transformations and business logic calculation. At this point, all the progress is stored in azure data lake Gen2.
When it comes to Gold zone, we are utilizaing spark to create databases and then the databases feed our BI tool (QlikSense). The reasoning is that we have various clients (Tenants) and we want to isolate their analytics database rather than having multi tenant architecture.

Database creation is done simply through spark notebook "Create Database if not exists". I cannot achieve a similar set up with fabric, if I assume my spark created database will be a fabric lakehouse at the end.

AmirHeidari_0-1713882712362.png


Such command will give error:

AmirHeidari_1-1713882753091.png

 

Is it possible to achieve a similar thing in Fabric through spark notebooks? What other option would you suggest?

1 ACCEPTED SOLUTION
frithjof_v
Super User
Super User

I never tried it, but this blog post seems to suggest you can create a Lakehouse from a Notebook by using mssparkutils (beginning of article) or Semantic-Link (bottom of article):

 

https://fabric.guru/programmatically-creating-managing-lakehouses-in-fabric

View solution in original post

2 REPLIES 2
frithjof_v
Super User
Super User

I never tried it, but this blog post seems to suggest you can create a Lakehouse from a Notebook by using mssparkutils (beginning of article) or Semantic-Link (bottom of article):

 

https://fabric.guru/programmatically-creating-managing-lakehouses-in-fabric

AndyDDC
Super User
Super User

Hi @Anonymous you can't create a "database" in Fabric, you create a Lakehouse (or Warehouse). Even though they appear as databases that syntax won't work.

 

So you can either create a lakehouse in the gui or use the rest apis

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.