Not able to copy entire files and folders recursively in specific folder in Azure Data Factory

Rohit Boddu 466 Reputation points
2020-09-23T17:00:15.65+00:00

Hi,

I want to copy data between two adls gen2 accounts. I am unable to copy all files and subfolders in specific folder to the destination.
Please check the attached screenshot which shows directory structure of my source adls account and destination adls account.

In my source adls account i have container "source-container" which has folder named "sourcefolder1" in it and which contains few files and few directories. i used azure data factory to copy data and i used wildcard method to copy the data.

27451-requirement.png

you can see in attached screenshot that i have 3 folders and some files in my source folder but after copying it has copied only files and not the directories.

previously using the same method i was able to copy all files and folders recursively but now it is failing.

In adf setting i have used "preserve hierachy" as copy behaviour and set "Recursive" to true in settings.

Regards,
Rohit Boddu.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,567 questions
{count} votes

2 answers

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,462 Reputation points Microsoft Employee
    2020-10-02T18:59:07.11+00:00

    Hi @Rene Løhde ,

    Thanks for your email. Could you please try using Wildcard file path setting in source settings of your copy as shown below:

    29971-image.png

    Hi @Rohit Boddu - Could you please clear browser cache and restart your browser and try below wildcard format in your source settings of Copy and see if that helps.

    29972-image.png

    I tried the above wildcard file path format and Copy activity is working as expected. Please let us know how it goes.
    Looking forward to your confirmation.
    Thank you

    1 person found this answer helpful.

  2. MartinJaffer-MSFT 26,081 Reputation points
    2020-10-20T23:29:17.613+00:00

    My findings as of 2020-10-20:

    If the folder is empty, it is not copied, unless you select at least one of the following settings:

    • Preserve ACL
    • Preserve Owner
    • Preserve Group
      33874-image.png
      Any one , or combination of, these will cause the empty folders on ADLS gen2 to be copied over.
      I am inquiring internally as to whether this is by design.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.