Hello @Kakehi Shunya (筧 隼弥) ,
Thanks for the question and using MS Q&A platform.
My understanding is that you would like to unzip all the files from multiple folders and subfolders under a parent folder/directory using ADF. Please correct me if I misunderstood the requirement.
In order to copy recursively from folder and subfolders, you will have to use wild card file path type in your source settings of your copy activity and then check the recursive
options as shown in below image:
The above settings will unzip all the zip files from the parent folder configured in your copy source settings using wild card and then copy them to desired destination by preserving the folder structure.
If case if you would like to copy all the files to a single target folder instead of preserving the source folder structure, then in Sink settings you can use flattenHierarchy
option as copyBehavior
, but doing so will not preserve the actual source file name but instead ADF will created autogenerated name
for the unziped copied files.
To explore more about copyBehavior please refer to this document: recursive and copyBehavior examples
Sink Settings for copy behavior:
By using this approach, you can avoid GetMetadata activity and ForEach activity and also the processing will be fast. And for any reason, if you have to use GetMetadata activity and loop through the list of files from folders and sub-folders under a parent directory, then you will have to implement a two-level pipeline (parent and a child pipeline using execute pipeline activity) as discussed in this thread: How to read files from sub folders in Azure data factory.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators