Have you tried with HTTP connector (rest api) to store file in Lake house.
Please check rest API documentation https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-api.
Please configure HTTP connector with proper headers and authentication to access lake house.
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")
headers = {"Authorization": f"Bearer {token}"}
response = requests.get(url, headers=headers)
files = response.json()
Also, please refer this document https://community.fabric.microsoft.com/t5/Data-Engineering/Listing-files-using-REST-API-in-Lakehouse/m-p/4383610
If this answer was helpful, please click "Accept the answer" and mark Yes
, as this can help other community members.
If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.