The task
The supplier drops a CSV like orders_2026-11-22.csv into its Blob container every day. We want it in ShopKart's lake as Parquet, in a dated folder:
๐Source
supplier-drop/incoming/orders_2026-11-22.csv (DelimitedText)
๐Copy activity
CSV โ Parquet, on the Azure IR
๐Sink
lake/raw/supplier_orders/2026/11/22/orders_2026-11-22.parquet
Build it in ADF Studio
| Step | In Studio |
|---|---|
| 1 | Author โ Pipelines โ New pipeline; name it PL_Copy_Supplier_File |
| 2 | Parameters tab: add fileName (String), default orders_2026-11-22.csv |
| 3 | Drag Move and transform โ Copy data onto the canvas |
| 4 | Source tab: dataset DS_Blob_SupplierCsv; set its fileName to @pipeline().parameters.fileName |
| 5 | Sink tab: dataset DS_ADLS_Parquet; set folderPath and fileName with expressions (below) |
| 6 | General tab: retry 2, retry interval 60 seconds, timeout 1 hour |
| 7 | Debug to test with the default file; Publish (or commit to Git) to save |
Studio saves it as this JSON:
{
"name": "PL_Copy_Supplier_File",
"properties": {
"description": "Copy one supplier CSV file into the lake as Parquet.",
"parameters": {
"fileName": {
"type": "string",
"defaultValue": "orders_2026-11-22.csv"
}
},
"activities": [
{
"name": "Copy CSV to Lake",
"type": "Copy",
"policy": {
"timeout": "0.01:00:00",
"retry": 2,
"retryIntervalInSeconds": 60
},
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings"
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "ParquetSink",
"storeSettings": {
"type": "AzureBlobFSWriteSettings"
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "DS_Blob_SupplierCsv",
"type": "DatasetReference",
"parameters": {
"fileName": {
"value": "@pipeline().parameters.fileName",
"type": "Expression"
}
}
}
],
"outputs": [
{
"referenceName": "DS_ADLS_Parquet",
"type": "DatasetReference",
"parameters": {
"folderPath": {
"value": "@concat('raw/supplier_orders/', replace(substring(pipeline().parameters.fileName, 7, 10), '-', '/'))",
"type": "Expression"
},
"fileName": {
"value": "@replace(pipeline().parameters.fileName, '.csv', '.parquet')",
"type": "Expression"
}
}
}
]
}
]
}
}The dynamic paths, evaluated
Two expressions build the sink path from the file name: substring(fileName, 7, 10) takes the date part (characters 7โ16, counting from 0), and replace(..., '-', '/') turns it into folders. We evaluated the pipeline for two files:
from data_factory_testing_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.state import RunParameter, RunParameterType
tf = TestFramework(framework_type=TestFrameworkType.DataFactory, root_folder_path="shopkart-adf")
pipeline = tf.get_pipeline_by_name("PL_Copy_Supplier_File")
for file_name in ["orders_2026-11-22.csv", "orders_2026-12-01.csv"]:
[copy] = tf.evaluate_pipeline(pipeline, [RunParameter(RunParameterType.Pipeline, "fileName", file_name)])
source = copy.all_properties["inputs"][0]["parameters"]
sink = copy.all_properties["outputs"][0]["parameters"]
print(f"read : supplier-drop/incoming/{source['fileName'].result}")
print(f"write: lake/{sink['folderPath'].result}/{sink['fileName'].result}")
print(f"retry: {copy.policy['retry']} times, {copy.policy['retryIntervalInSeconds']} s apart\n")read : supplier-drop/incoming/orders_2026-11-22.csv
write: lake/raw/supplier_orders/2026/11/22/orders_2026-11-22.parquet
retry: 2 times, 60 s apart
read : supplier-drop/incoming/orders_2026-12-01.csv
write: lake/raw/supplier_orders/2026/12/01/orders_2026-12-01.parquet
retry: 2 times, 60 s apartDated folders (yyyy/MM/dd) matter: later jobs read one day by folder, and re-running a day overwrites only that day's file. That makes the copy idempotent, which is safe to retry.
Source and sink settings worth knowing
| Setting | Where | What it does |
|---|---|---|
| Wildcard file path (*.csv) | Source (files) | Copy many files in one activity |
| Filter by last modified | Source (files) | Only files changed in a time range: simple incremental for files |
| Query / stored procedure | Source (databases) | Copy the result of a SELECT instead of a whole table |
| Pre-copy script | Sink (databases) | Run SQL first, e.g. TRUNCATE a staging table |
| Write behavior: insert / upsert | Sink (Azure SQL etc.) | Upsert updates existing keys and inserts new ones |
| Copy behavior: preserve hierarchy / merge files | Sink (files) | Keep folder structure, or combine into one file |
| Mapping | Mapping tab | Map source columns to sink columns; import schemas; type conversion |
Performance and fault tolerance
| Knob | Meaning | Tip |
|---|---|---|
| Data Integration Units (DIUs) | Power of the Azure IR for this copy (2โ256) | Leave on Auto; raise only for big file copies that are slow |
| Degree of copy parallelism | Parallel threads reading/writing | Auto is usually right; for databases, partition the source instead |
| Source partitioning (databases) | Read a big table in parallel ranges | Physical partitions or a dynamic range on a numeric/date column |
| Staged copy | Go through interim Blob storage | Needed for some sinks (e.g. Synapse PolyBase / COPY), or across networks |
| Fault tolerance | Skip incompatible rows | Always log skipped rows to storage so nothing disappears silently |
| Data consistency verification | Check files/rows match after copy | Good for regulated data |
๐ฏ Interview questions on this topic
Try to answer out loud first, then tap to check.
Q1What is the Copy activity?Fresher+
Q2How do you copy many files with one Copy activity?Fresher+
Q3How do you improve Copy performance?1โ3 yrs+
Q4How do you handle bad rows during a copy?1โ3 yrs+
Q5Copy 500 tables from an on-prem SQL Server to the lake nightly. Design it.3+ yrs+
Key takeaways
- โOne parameterized Copy handles every daily file.
- โExpressions build tidy, dated lake paths.
- โRetries plus idempotent writes make failures harmless.
- โTune with the copy monitoring breakdown, not guesses.
Frequently asked questions
What does the Copy activity do?
It reads data from a source dataset and writes it to a sink dataset, converting formats on the way (CSV to Parquet, SQL table to JSON, and so on). It's ADF's most-used activity and runs on the integration runtime you choose.
What is a DIU?
A Data Integration Unit: a measure of CPU, memory and network the Azure integration runtime uses for one copy. More DIUs can make big copies faster and cost more (billed per DIU-hour). By default ADF picks the number automatically.
Why convert CSV to Parquet?
Parquet is columnar and compressed: files are much smaller, keep data types, and tools like Databricks, Synapse and Snowflake read them far faster than CSV. Landing raw files as Parquet is a common first step in a lake.
Can Copy skip bad rows instead of failing?
Yes. Turn on fault tolerance (skip incompatible rows) and, ideally, log the skipped rows to a storage folder so you can inspect them. Otherwise one bad row fails the whole copy.
Copy activity or data flow?
Copy for moving data with simple mapping and format conversion: cheaper and faster to start. Data flows for real transformations (joins, aggregations, de-duplication) without writing code. Many pipelines copy first, then transform.
๐ง Quick check: Copy activity
1. Copy reads from the ___ and writes to the ___.
2. Our file orders_2026-12-01.csv lands in which lake folder?
3. One bad row should not stop a 10-million-row copy, but must not be lost. Use...
4. The retry policy on our Copy means...
Checking your accessโฆ