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
AmirHeidari
Frequent Visitor

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Most Valuable Professional
Most Valuable Professional

Hi @AmirHeidari 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
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.