Essential cookies keep authentication working. With your permission, we also use analytics cookies to understand and improve the product. Read our Privacy Policy

DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPricingBlog
ProLogin
Home/Questions/Cloud/Tools/How do you copy all files from one source path to target in ADF?

How do you copy all files from one source path to target in ADF?

Cloud/Toolseasy1 min read

Reviewed by Aditya Kumar Β· Last reviewed 2026-08-08

In Azure Data Factory (ADF), you can copy all files from a source path to a target using primarily two methods: a single Copy Data activity with wildcards, or a combination of GetMetadata, ForEach,…

πŸ€– Analyze Your Answer
Frequency
Low
Asked at 1 company
Category
179
questions in Cloud/Tools
Difficulty Split
104E|27M|48H
in this category
Total Bank
1,863
across 7 categories
Asked at these companies
Hexaware

Why This Question Matters

This easy-level Cloud/Tools question appears frequently in data engineering interviews at companies like Hexaware. While less common, it tests deeper understanding that distinguishes strong candidates.

How to Approach This

Start by clearly defining the core concept being asked about. Interviewers want to see that you understand the fundamentals before diving into implementation details. Structure your answer with a definition, then explain the practical application with a concise example. The expert answer includes a code example that demonstrates the implementation pattern.

Expert Answer
286 wordsIncludes code

In Azure Data Factory (ADF), you can copy all files from a source path to a target using primarily two methods: a single Copy Data activity with wildcards, or a combination of GetMetadata, ForEach, and Copy Data activities.

Method 1: Copy Data with Wildcards

This is the most straightforward and performant method for bulk file transfers. You configure a single Copy Data activity where the source dataset's file path or folder path includes a wildcard character (e.g., *). ADF efficiently handles the enumeration and copying of all matching files within that path.

# Example Source Dataset Path
data/raw/source_folder/*

This approach is ideal for "lift and shift" scenarios, archiving, or replicating entire directories where no per-file specific logic is required. ADF optimizes the transfer, often leveraging parallel processing internally for better throughput.

Method 2: GetMetadata, ForEach, and Copy Data

This method provides granular control over individual files. First, a GetMetadata activity is used to retrieve a list of child items (files and subfolders) from the source folder. Then, a ForEach activity iterates through this list. Inside the ForEach loop, a Copy Data activity copies each file, using dynamic content like @item().name or @item().fullName to specify the current file's path.

This pattern is necessary when you need to apply specific logic to each file, such as filtering files based on their name or size, conditionally processing them, or performing transformations before copying. While offering flexibility, it introduces overhead due to the iterative nature, potentially making it slower for a very large number of files compared to the wildcard approach.

In the interview, also mention: Discuss how error handling (e.g., on failure paths) and logging would be implemented for each method, especially for large-scale operations.

⚑
Pro Tip

Red Flag: Sequential copy when wildcard would work. Pro-Move: 'We use wildcard for bulk; GetMetadata+ForEach when we need to skip or transform per file.'

Want all answers as a PDF for offline study?
Seven focused volumes with 750+ in-depth answers β€” Answer Vault β†’

Related Cloud/Tools Questions

easyWhat are Airflow Operators? Give examples.FreeeasyExplain the difference between Azure Data Factory (ADF) and Databricks.FreeeasyHow do you handle data security and compliance in a cloud environment?FreehardWhat are the key components of AWS Glue, and how do they work together?FreeeasyWhat is Azure Data Factory (ADF), and what are its main components?Free

Level up your prep

Recommended
Educative
Educative Unlimited

800+ hands-on courses β€” Grokking System Design, Coding Patterns, and AI mock interviews for your DE loop.

Start learning β†’

Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you β€” it helps keep DataEngPrep free.

According to DataEngPrep.tech, this is one of the most frequently asked Cloud/Tools interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.

← Back to all questionsMore Cloud/Tools questions β†’
Categories
All QuestionsSQLSpark / Big DataPython / CodingSystem DesignCloud / ToolsBehavioral
By Company
AmazonGoogleDatabricksSnowflakeAWSAzureMicrosoftNetflixUberTCS
Interview Guides
All GuidesTop SQL QuestionsTop Spark QuestionsPySpark QuestionsTop Python QuestionsTop System DesignKafka QuestionsAirflow QuestionsSQL Window FunctionsETL QuestionsData Modeling
Products
AI Interview CoachAnswer AnalyzerSQL PlaygroundResume AnalyzerAnswer Vault PDFsPricing
Company
About & Editorial PolicyContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
Β© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer