Azure Data Factory Tutorial: A Detailed Explanation For Beginners
Azure Data Factory (ADF) is a cloud-based data integration service that lets you create, schedule, and orchestrate data pipelines to move and transform data at scale, without writing extensive custom code.
Core Components
- Pipelines — logical grouping of activities that perform a unit of work
- Activities — individual processing steps such as copy, transform, or execute
- Datasets — pointers to the data you want to use in an activity
- Linked Services — connection information to external resources like databases or storage
- Integration Runtime — the compute infrastructure that executes the activities
Building a Basic Pipeline
- Create linked services for your source and destination
- Define datasets that represent the input and output data
- Add a Copy Data activity to move data between the two
- Set a trigger to run the pipeline on a schedule or in response to an event
Why Teams Use ADF
- Serverless, pay-for-what-you-use pricing model
- Over 90 built-in connectors to popular data sources
- Visual, code-free pipeline authoring with the drag-and-drop UI
- Native integration with Azure Synapse, Databricks, and Azure Functions
Ready to master Microsoft Azure?
Join Microsoft Azure Training Course at Uncodemy and learn with hands-on projects and mentor support.
Walk-Through: Copying a Daily CSV from Blob Storage into Azure SQL
A common first project is loading a sales file that lands in Blob Storage every day into a table in Azure SQL Database. Here is how the pieces fit together in practice:
- Create two linked services. One points to the storage account and one to the SQL database. Prefer managed identity authentication, or keep secrets in Azure Key Vault, instead of pasting passwords into the linked service.
- Create a delimited-text dataset for the CSV, with the container and folder set, and a table dataset for the target SQL table.
- Add a Copy activity and map the CSV columns to the table columns. Use the preview option to confirm the header row and delimiter are detected correctly.
- Debug the pipeline once to test it without publishing, then publish when it succeeds.
- Attach a trigger and watch the first scheduled run in the Monitor hub.
Behind the visual designer, every pipeline is stored as JSON. A trimmed version of the copy step looks like this:
{
"name": "CopySalesCsvToSql",
"type": "Copy",
"inputs": [ { "referenceName": "SalesCsv", "type": "DatasetReference" } ],
"outputs": [ { "referenceName": "SalesTable", "type": "DatasetReference" } ],
"typeProperties": {
"source": { "type": "DelimitedTextSource" },
"sink": { "type": "AzureSqlSink" }
}
}
Connecting the factory to a Git repository lets you review these JSON changes like any other code and promote them from development to production.
Parameters, Expressions and Trigger Types
Hard-coding a file name works once. Parameters let the same pipeline handle any day's file. You can add a pipeline parameter such as fileName and pass it to the dataset, or build the value with the expression language:
@concat('sales_', formatDateTime(utcnow(), 'yyyyMMdd'), '.csv')
Expressions start with @ and can read pipeline parameters, variables, trigger details and the output of earlier activities.
| Trigger type | Fires when | Good fit |
|---|---|---|
| Schedule | A clock schedule is reached | Nightly or hourly loads |
| Tumbling window | Each fixed, non-overlapping time slice ends | Backfills and loads that must process every window exactly once |
| Storage event | A blob is created or deleted | Processing files as soon as they arrive |
| Custom event | An Event Grid event is published | Starting pipelines from other applications |
The integration runtime also matters. The Azure integration runtime handles cloud-to-cloud copies, a self-hosted integration runtime reaches databases inside a private or on-premises network, and the Azure-SSIS integration runtime runs existing SSIS packages.
Mistakes to Avoid in Your First Pipelines
- Reloading everything every run. For large tables, use an incremental pattern: store a watermark such as the last modified time, and copy only rows newer than it.
- Ignoring failures. Set retry counts on activities and add a failure path, for example a Web activity that posts an alert, so broken runs do not go unnoticed.
- Editing straight in production. Work in a development factory linked to Git and deploy through a release process.
- Using ADF for heavy logic. Complex joins and machine learning belong in Mapping Data Flows, Databricks or SQL; let ADF orchestrate them.
Checklist before scheduling a pipeline
- Credentials come from managed identity or Key Vault.
- File names, folders and dates are parameters, not fixed text.
- Activities have retries and a clear failure notification.
- The pipeline has run successfully in debug mode with real sample data.