Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PANDAmonium
Resolver IV
Resolver IV

Copy Lakehouse Files

Hi All,
 
I'm trying to use a notebook to copy the Files directory from one lakehouse to another. It looks something like this:
 
sourcePath = f"{[sourceAbfsPath]}/Files"
targetPath = f"{[targetAbfsPath]}/Files"
notebookutils.fs.cp(sourcePath, targetPath, True)
 
That creates the addition Files subdirectory so Files>Files>test.xlsx
If I remove Files from the target or source path it gives a Bad Request 400 Error.
 
Without having to list the contents and copy them individually, is there a way to copy the entire files directory correctly?
 
Thanks!
1 ACCEPTED SOLUTION
PANDAmonium
Resolver IV
Resolver IV

I also can't move directories or files into the Files folder using 

notebookutils.fs.mv() . Possibly due to the Files folder being a managed OneLake folder so CRUD operations are restricted to it.  This post, mssparkutils file operations, ran into the same issue and has a more detailed explination in the replies. Going to follow their solution of creating a subdirectory within Files to house everything; it seems like the simplest and most flexible solution.

View solution in original post

2 REPLIES 2
PANDAmonium
Resolver IV
Resolver IV

I also can't move directories or files into the Files folder using 

notebookutils.fs.mv() . Possibly due to the Files folder being a managed OneLake folder so CRUD operations are restricted to it.  This post, mssparkutils file operations, ran into the same issue and has a more detailed explination in the replies. Going to follow their solution of creating a subdirectory within Files to house everything; it seems like the simplest and most flexible solution.
GeraldGEmerick
Solution Sage
Solution Sage

@PANDAmonium There is a similar solved solution here: Solved: Copy tables and files (quickly) between two lakeho... - Microsoft Fabric Community. I believe that this should help you get you where you need to be.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors