The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I have two lakehouses, call them lh1 and lh2, and there is a shortcut from lh1 to lh2
When trying to create a file via the shortcut, I get an error if the file does not already exist on the path. If the file already exists on the path, then the write operation works fine.
Example:
Solved! Go to Solution.
Hi @truls_sg ,
Thank you for reaching out to Microsoft Fabric Community.
The issue occurs because shortcuts in Fabric lakehouses are read-only, meaning you can't create new files or folders through them - only read or overwrite existing files. That's why your code works only if the file already exists.
Set lh1 (the source lakehouse of the shortcut) as your default lakehouse in the notebook when writing files. This allows you to create new files successfully:
data = {"name": "John Doe", "age": 30, "city": "New York"}
with open("/lakehouse/default/Files/shortcut_folder/data.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4, ensure_ascii=False)
If you're using lh2 as default, writing to a shortcut will only work for existing files - creation is blocked by design.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi @truls_sg ,
Thank you for reaching out to Microsoft Fabric Community.
The issue occurs because shortcuts in Fabric lakehouses are read-only, meaning you can't create new files or folders through them - only read or overwrite existing files. That's why your code works only if the file already exists.
Set lh1 (the source lakehouse of the shortcut) as your default lakehouse in the notebook when writing files. This allows you to create new files successfully:
data = {"name": "John Doe", "age": 30, "city": "New York"}
with open("/lakehouse/default/Files/shortcut_folder/data.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4, ensure_ascii=False)
If you're using lh2 as default, writing to a shortcut will only work for existing files - creation is blocked by design.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
So that is where my confusion comes in, becuase in my experience read only access usually does not allow you to modify existing files.
Thank you for the answer!
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
1 |
User | Count |
---|---|
17 | |
15 | |
11 | |
6 | |
6 |