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

Listing files using REST API in Lakehouse

i am trying to list the file of lakehouse using reatapi but it is not working but when i am trying using tables it is propely working
and i am following this Items - List Lakehouses - REST API (Lakehouse) | Microsoft Learn documentation for listing tables

i am using this url for table:https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/lakehouses/{lakehouseId}/Tables
and i am getting proper result

munindra_0-1737351651336.png

similarly when i am trying with https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/lakehouses/{lakehouseId}/Files
for files

munindra_1-1737351905832.png

 




2 ACCEPTED SOLUTIONS
nilendraFabric
Community Champion
Community Champion

Hi @munindra 

 

The issue you’re encountering is due to the differences in API endpoints for listing tables versus files in a Microsoft Fabric Lakehouse.
For listing files in a Lakehouse, you need to use a different API endpoint. The correct approach is to use the Azure Data Lake Storage Gen2 REST API, as the Lakehouse files are stored in OneLake, which is compatible with ADLS Gen2.

 

To list files, you should use an endpoint similar to this

https://onelake.dfs.fabric.microsoft.com/{workspaceId}/{lakehouseId}.lakehouse/Files?resource=filesy...

You’ll need to include the appropriate authentication headers, typically using a bearer token obtained for the ‘storage’ scope.

 

 

use this approach and see

 

import requests

workspace_id = "your_workspace_id"
lakehouse_id = "your_lakehouse_id"
token = mssparkutils.credentials.getToken("storage")

url = f"https://onelake.dfs.fabric.microsoft.com/{workspace_id}/{lakehouse_id}.lakehouse/Files?resource=file..."
headers = {"Authorization": f"Bearer {token}"}

response = requests.get(url, headers=headers)
files = response.json()

 

please accept the solution and give kudos if this is helpful.

 

Thanks

Nilendra

View solution in original post

5 REPLIES 5
v-shamiliv
Community Support
Community Support

Hi @munindra , 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-shamiliv
Community Support
Community Support

Hi @nilendraFabric 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-shamiliv
Community Support
Community Support

Hi @munindra 
Thank you for reaching out microsoft fabric community forum.
I wanted to check if you had the opportunity to review the information provided by @nilendraFabric . Please feel free to contact us if you have any further questions. If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

nilendraFabric
Community Champion
Community Champion

Hi @munindra 

 

The issue you’re encountering is due to the differences in API endpoints for listing tables versus files in a Microsoft Fabric Lakehouse.
For listing files in a Lakehouse, you need to use a different API endpoint. The correct approach is to use the Azure Data Lake Storage Gen2 REST API, as the Lakehouse files are stored in OneLake, which is compatible with ADLS Gen2.

 

To list files, you should use an endpoint similar to this

https://onelake.dfs.fabric.microsoft.com/{workspaceId}/{lakehouseId}.lakehouse/Files?resource=filesy...

You’ll need to include the appropriate authentication headers, typically using a bearer token obtained for the ‘storage’ scope.

 

 

use this approach and see

 

import requests

workspace_id = "your_workspace_id"
lakehouse_id = "your_lakehouse_id"
token = mssparkutils.credentials.getToken("storage")

url = f"https://onelake.dfs.fabric.microsoft.com/{workspace_id}/{lakehouse_id}.lakehouse/Files?resource=file..."
headers = {"Authorization": f"Bearer {token}"}

response = requests.get(url, headers=headers)
files = response.json()

 

please accept the solution and give kudos if this is helpful.

 

Thanks

Nilendra

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.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 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.