Azure Data Factory Design Patterns

Watch the video to deepen your understanding.
SubscribeComplete the full lesson to earn 25 points — 50 with Pro
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks, the wait, and see fewer ads — read each lesson on a single page with Pro
Lesson: Azure Data Factory (ADF) Design Patterns
1. Introduction
In modern data engineering, building robust, scalable, and maintainable data pipelines is critical. Azure Data Factory (ADF) is a cloud-based ETL and data integration service that allows you to create data-driven workflows for orchestrating data movement and transforming data at scale.
However, simply connecting sources to sinks is insufficient for enterprise-grade solutions. Design Patterns are reusable solutions to commonly occurring problems in pipeline architecture. By adopting established patterns, you reduce development time, improve reliability, and ensure your data integration layer can handle the complexities of evolving business requirements.
2. Core ADF Design Patterns
A. The "Metadata-Driven" Pipeline Pattern
Instead of hardcoding pipeline activities for every table or file, the metadata-driven pattern uses a control table (stored in Azure SQL or Cosmos DB) to define the scope of data movement.
How it works:
- A Lookup activity queries a database table containing source/sink metadata (e.g., table names, schema, watermarks).
- A ForEach activity iterates through the list of tables.
- Inside the loop, an Execute Pipeline or Copy Activity uses dynamic expressions to map the metadata to the connection strings or file paths.
Example Dynamic Expression: If you are iterating through a list of tables, you can dynamically reference the source table in your Copy Activity source dataset:
// Dynamic expression for source table name
@item().SourceTableName
B. The "Incremental Load" (Watermark) Pattern
Loading full datasets every day is inefficient and costly. The Incremental Load pattern ensures only new or modified data is processed.
How it works:
- Lookup Old Watermark: Fetch the last processed timestamp from a control table.
- Lookup New Watermark: Fetch the
MAX(LastModifiedDate)from the source system. - Copy Activity: Use a query filter:
SELECT * FROM Orders WHERE LastModifiedDate > '@{activity('OldWatermark').output.firstRow.WatermarkValue}' AND LastModifiedDate <= '@{activity('NewWatermark').output.firstRow.NewValue}'. - Stored Procedure: Update the control table with the new watermark value.
C. The "Hub-and-Spoke" Orchestration Pattern
In large organizations, you often have a "Master" pipeline that triggers "Child" pipelines. This promotes modularity.
- Master Pipeline: Handles global logic, such as error logging, variable initialization, and controlling the sequence of execution.
- Child Pipelines: Perform specific, reusable tasks (e.g., "Ingest Salesforce Data," "Clean Customer Dim," "Archive Logs").
3. Practical Implementation: Dynamic Copy
To implement a dynamic pattern, you must use Parameterized Datasets.
Step 1: Create a Dataset Parameter
In your dataset, go to the Parameters tab and add SchemaName and TableName.
Step 2: Use the parameter in the Connection string In the Connection tab, use the dynamic content editor:
@dataset().SchemaName
@dataset().TableName
Step 3: Call from Pipeline
When using the Copy Activity, pass these values from your ForEach loop:
// Inside ForEach activity
"typeProperties": {
"dataset": {
"referenceName": "SourceTableDataset",
"type": "DatasetReference",
"parameters": {
"SchemaName": "@item().Schema",
"TableName": "@item().Table"
}
}
}
4. Best Practices & Common Pitfalls
Best Practices
- Use Parameterization: Never hardcode connection strings, file paths, or table names. Use ADF Parameters and Global Parameters.
- Implement Error Handling: Always connect a "Failure" path (red arrow) from your activities to a logging or notification activity (e.g., Send an email via Logic Apps or log to a SQL table).
- Self-Hosted Integration Runtime (SHIR) Scaling: If moving massive amounts of data from on-premises, ensure your SHIR is installed on a machine with sufficient CPU/RAM and consider high-availability clusters.
- Source Control (Git): Always integrate your ADF instance with Azure DevOps or GitHub. Never develop directly in the "Live" mode for production environments.
Common Pitfalls
- Over-complicating Logic: If your pipeline has 50+ activities, it is too complex. Break it down into smaller, child pipelines.
- Ignoring Cost: The "ForEach" activity, when configured with
isSequential: false, runs in parallel. If you have 100 iterations, you may hit your source system's throughput limits or trigger unexpected costs. - Hardcoding Credentials: Never put passwords or API keys in pipeline strings. Always use Azure Key Vault linked services to reference secrets.
💡 Pro-Tip: The "Wait" Activity
When dealing with dependencies (e.g., waiting for a file to land in Data Lake), avoid using a "Wait" activity. Instead, use an Until activity coupled with a Get Metadata activity to check for the file's existence. This is more efficient and reliable.
5. Key Takeaways
- Modularity is Key: Design your pipelines to be reusable. If you find yourself copying and pasting an activity block, it should be a child pipeline.
- Metadata is Power: Use metadata-driven patterns to allow your ADF environment to scale automatically as you add more data sources without needing to manually create new pipelines.
- Security First: Always use Managed Identities and Azure Key Vault. Avoid passing plain-text credentials at all costs.
- Observability: Your design should always include logging. If a pipeline fails, you should know exactly which step failed and why, without needing to manually inspect the ADF UI.
- Performance: Monitor your Data Integration Units (DIUs) and SHIR performance. Parallelism is good, but throttle it based on the constraints of your source and sink systems.
Reach the last section to complete this lesson and earn points — you're on section 1 of 2.
- Introduction to Azure Monitor
- Azure Monitor Architecture and Data Sources
- Configuring Log Analytics Workspaces
- Designing Log Routing Solutions
- Configuring Diagnostic Settings
- Application Insights for Solution Architects
- Network Watcher and Network Monitoring
- Azure Monitor Alerts and Action Groups
- Workbooks and Custom Dashboards
- Designing a Comprehensive Monitoring Strategy
- Logging and Monitoring Quiz5q
- Microsoft Entra ID for Solution Architects
- Designing Identity Solutions: B2B Collaboration
- Designing Identity Solutions: B2C Scenarios
- Conditional Access Policy Design
- Designing for Multi-Factor Authentication
- Managed Identities for Azure Resources
- Service Principals and App Registrations
- Role-Based Access Control Design
- Privileged Identity Management
- Microsoft Entra ID Protection
- Zero Trust Architecture with Microsoft Entra
- Authentication and Authorization Quiz5q
- Introduction to Azure Governance
- Designing Management Group Hierarchies
- Subscription Strategy Design
- Resource Group Organization Patterns
- Azure Policy Design and Assignment
- Custom Policy Definitions and Initiatives
- Resource Locks and Tagging Strategies
- Azure Blueprints and Landing Zones
- Cost Management and Budget Design
- Cloud Adoption Framework for Governance
- Governance Solutions Quiz5q
- Introduction to Azure Storage
- Storage Account Types and Replication
- Blob Storage Tiers and Lifecycle Management
- Azure Files and Azure NetApp Files
- Azure Managed Disks Design
- Azure Data Lake Storage Gen2
- Cosmos DB Consistency Models
- Cosmos DB Partitioning and Throughput Design
- Cosmos DB API Selection Guide
- Table Storage and Queue Storage Design
- Storage Security and Encryption
- Non-Relational Storage Quiz5q
- Azure SQL Database Service Tiers
- Azure SQL Managed Instance Design
- Azure Database for MySQL and PostgreSQL
- Database Scaling: Vertical and Horizontal
- Read Replicas and Geo-Replication
- Database Security and Auditing Design
- Transparent Data Encryption and Always Encrypted
- Caching with Azure Cache for Redis
- Azure SQL Elastic Pools Design
- Relational Storage Quiz5q
- Azure Data Factory Design Patterns
- Data Integration Pipeline Architecture
- Azure Synapse Analytics Design
- Azure Databricks Integration Patterns
- Azure Stream Analytics for Real-Time Data
- Azure Event Hubs for Data Ingestion
- Data Migration Strategies and Tools
- Azure Purview for Data Governance
- Data Integration Quiz5q
- Introduction to High Availability in Azure
- Availability Zones and Availability Sets
- Azure Load Balancer Design
- Application Gateway and WAF Design
- Azure Front Door and Global Load Balancing
- Azure Traffic Manager Routing Methods
- Multi-Region Architecture Design
- SLA Design and Composite SLAs
- Health Probes and Failover Configuration
- Azure Service Fabric for Stateful HA
- High Availability Quiz5q
- Azure Backup Architecture and Vaults
- Backup Policies for VMs and Databases
- Azure Site Recovery Design
- RTO and RPO Planning Strategies
- Geo-Redundant and Cross-Region Recovery
- Hybrid and On-Premises Backup Solutions
- Resiliency Patterns and Chaos Engineering
- Disaster Recovery Testing and Drills
- Azure Immutable Backup and Soft Delete
- Backup and Disaster Recovery Quiz5q
- Introduction to Azure Compute Options
- Virtual Machine Design and Sizing
- VM Scale Sets and Autoscaling Strategies
- Azure Batch for Large-Scale Workloads
- Azure App Service Plans and Design
- App Service Environments and Isolation
- Azure Container Instances
- Azure Kubernetes Service Architecture
- AKS Networking and Storage Design
- Azure Functions and Serverless Design
- Durable Functions and Orchestration
- Compute Decision Framework
- Azure Virtual Desktop Design
- Compute Solutions Quiz5q
- Microservices Architecture Patterns
- Azure API Management Design
- Azure Service Bus Messaging Design
- Azure Event Grid and Event-Driven Architecture
- Azure Event Hubs for Streaming
- Azure Logic Apps and Integration Workflows
- Azure SignalR and Web PubSub
- Caching Strategies and Azure CDN
- App Configuration and Feature Flags
- Designing for Scalability and Performance
- Azure Container Apps Design
- Application Architecture Quiz5q
- Virtual Network Design and Address Planning
- Subnet Design and Network Segmentation
- Hub-Spoke Network Topology
- Azure Virtual WAN Design
- VPN Gateway Design and Configuration
- ExpressRoute Circuit Design
- Network Security Groups Design
- Azure Firewall and Firewall Manager
- Azure DDoS Protection Design
- Private Endpoints and Private Link
- Azure DNS and DNS Architecture
- Network Performance and Traffic Routing
- Azure Bastion and Secure Access
- Network Solutions Quiz5q
- Azure Migrate Overview and Assessment
- Migration Assessment and Discovery
- Azure Cloud Adoption Framework for Migration
- VM Migration with Azure Migrate
- Database Migration with Azure DMS
- Application Migration to App Service
- Containerizing Applications for Migration
- Migration Cost Planning and Optimization
- Data Box and Offline Migration Methods
- Migrations Quiz5q
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles the points you earn on every lesson and quiz so you progress twice as fast, unlocks half of every practice exam — plus full case studies — with the Learn & Exam study modes, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× points per lesson & quiz
- ✓ 50% of every exam unlocked
- ✓ Learn & Exam modes
- ✓ Distraction-free lessons