Pragmatic Works Nerd News

How YOU Can Create Lakehouses Using the Microsoft Fabric API!

Written by Zane Goodman | May 17, 2026

    In this video, Zane Goodman from Pragmatic Works demonstrates how to create a lakehouse using the Microsoft Fabric REST API. He provides a step-by-step guide on leveraging the Fabric API to dynamically create a lakehouse using Python in a Fabric notebook.

 

Introduction

Zane Goodman starts the video by introducing the topic and explaining the importance of the Microsoft Fabric REST API. He mentions that the API connects to PowerBI and provides extensive documentation on creating a lakehouse.

Setting Up the Environment

Zane guides viewers to set up their environment by opening a notebook in their workspace. He emphasizes the importance of having proper access to the workspace.

Importing Required Libraries

To make a request to the API, Zane imports the 'requests' library. He then defines the API endpoint URL, which requires a workspace ID. He explains how to obtain the workspace ID from the URL of any workspace.

Breaking Down the Code

Zane breaks the code into chunks for better readability and best practices. He starts with defining headers, specifying the content type as 'application/json'. He also mentions the authorization header, which will be discussed later.

Defining Data

Next, Zane defines the data required for creating a lakehouse, including the display name and description. He explains that additional data points can be passed to change the result.

Making a POST Request

Zane creates a response variable to make a POST request to the API endpoint. He passes the URL, JSON data, and headers. He runs the code and encounters a 403 error due to improper authentication.

Creating an Access Token

Zane explains the process of creating an access token using the 'notebookutils' library. He demonstrates how to import the 'get_token' function and create a token variable. The token is used for authentication in the headers dictionary.

Running the Code

After creating the token, Zane runs the code again and successfully creates a lakehouse. He prints the status code and response JSON, which includes details of the created lakehouse.

Exploring the Lakehouse

Zane opens the created lakehouse and explores the Lakehouse Explorer. He encourages viewers to manage the items inside the lakehouse.

Conclusion

Zane concludes the video by asking viewers if they are interested in more content about using the Fabric API. He promotes Pragmatic Works' on-demand learning platform, offering courses on Fabric and PySpark in Fabric notebooks.

Overall, Zane Goodman provides a comprehensive guide on creating a lakehouse using the Microsoft Fabric REST API, making it accessible for viewers to follow along and implement in their own projects.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Microsoft Fabric API and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.