Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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
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
similarly when i am trying with https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/lakehouses/{lakehouseId}/Files
for files
Solved! Go to Solution.
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
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
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.
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.
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.
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.