Bad data stopped at the gate. Every run on record.
- Type
- technical
- Role
Designed, built, deployed and ran the whole reference implementation, as an independent project
- Context
- SME banking teams need onboarding, lending and transaction analytics they can trust, but source extracts are never clean. The question this answers: what is the smallest enterprise-grade Azure lakehouse that handles bad data predictably, and can be defended in front of risk and architecture reviewers? It is informed by experience in enterprise SME banking transformation, but it is an independent build: no client code, no client data, no client deployment.
01The brief
Batches of synthetic SME banking data arrive late, duplicated and malformed, with personal data mixed in. The platform lands them, keeps the raw record, validates and quarantines bad rows, merges the good ones incrementally, and publishes masked gold tables for an executive dashboard. Four orchestrated runs in Azure show it working, failing safely and recovering.
SME banking teams need onboarding, lending and transaction analytics they can trust, but source extracts are never clean. The question this answers: what is the smallest enterprise-grade Azure lakehouse that handles bad data predictably, and can be defended in front of risk and architecture reviewers? It is informed by experience in enterprise SME banking transformation, but it is an independent build: no client code, no client data, no client deployment.
Azure Data Factory orchestrates and moves data. Azure Databricks runs all transformation in PySpark over Delta Lake tables in ADLS Gen2. A Bronze, Silver and Gold design separates raw, clean and business-ready data. Infrastructure is deployed with Bicep, Data Factory logs go to Log Analytics, and the gold KPI tables feed a Power BI report.
Challenges
- Bad data has to be handled predictably: set aside with a reason, never silently dropped or loaded
- A badly corrupted batch must stop before it touches clean data, and recovery must be simple
- Incremental loads must update existing records and add new ones without rebuilding everything
- Personal data must not reach the tables an executive dashboard reads
- The cloud run has to be proven with evidence, not described
02How it works
Purpose
Move each batch of synthetic source extracts into the landing zone without transforming anything. Orchestration and transformation stay in separate tools.
Inputs
- → Six synthetic entities: customers, accounts, transactions, onboarding, loans, support
- → A batch id passed to the pipeline as a parameter
Outputs
- ← Batch files in the ADLS Gen2 landing container
- ← A Databricks notebook run with the batch id
Considerations
- Azure Data Factory only copies, retries and orders steps. It holds no business logic
- Data Factory reaches storage and Databricks through its managed identity
03Approach
My role
- Designed, built, deployed and ran the whole reference implementation, as an independent project
Approach
- Data Factory for movement, retries and ordering only. Databricks for every transformation, so there is one place where the logic lives
- Bronze keeps the raw record with lineage. Silver enforces the schema, rules and keys, removes duplicates and applies incremental Delta MERGE. Gold publishes dimensions, facts and KPI tables
- A data-quality gate per batch: rows that fail a rule go to quarantine with the rule name and original payload, and above a 10% invalid rate the batch is blocked and Silver is left untouched
- Gold carries masked emails and phone numbers and pseudonymised customer keys, and every run writes run and quality results to audit tables
- Bicep deploys storage, Data Factory, Databricks, Log Analytics and a failure alert. Seven automated tests run the real Spark and Delta code path
- Four runs of the same Data Factory pipeline: initial load, incremental load, a deliberately corrupted batch, and a corrected re-delivery
- Orchestrate in one tool, transform in another
- Data Factory only moves data and sequences steps. Databricks does all transformation. The logic lives in one place, so it can be tested locally and reviewed once.
- Gate the whole batch
- If a table is more than 10% invalid, the entire batch stops. Loading some entities and not others would break the links between customers, accounts and transactions. Because steps are idempotent, recovery is re-delivering a corrected batch.
- Quarantine, do not delete
- Every rejected row is kept with the rule it broke and its original payload. A risk reviewer can see what was refused and why.
- Mask before the dashboard
- Gold holds masked contact details and pseudonymised keys, so the executive layer never reads raw personal data.
04Results
4
Orchestrated cloud runs
11,206
Transactions in Silver
1,565
Records quarantined
100 / 46
Customers inserted / updated
44.9%
Invalid transactions blocked
7 of 7
Automated tests
- Initial and incremental loads, an intentional failure and a clean recovery all ran through Data Factory and Databricks in Azure
- The corrupted batch had 673 of 1,500 transactions invalid (44.9%) against a 10% threshold. It was blocked, Silver was untouched, and the run failed as designed
- The incremental batch inserted 100 customers and updated 46 existing ones through Delta MERGE
- After the four runs Silver held 11,206 transactions, and 1,565 rejected records sat in quarantine with their reasons
- Cloud row counts match the local run on the same data, and 7 of 7 automated tests pass
05Evidence


06Honest limits
- An independent reference implementation on entirely synthetic, fictional data. It is not a client deployment, uses no client code or data, and is not a production banking system.
- Microsoft Fabric and OneLake were not integrated. A Fabric trial was refused for the tenant used here. My Fabric and OneLake work is in Gov Policy Copilot, a separate project.
- The Power BI report has three visuals, built from CSV exports of the cloud Gold tables. There is no scheduled refresh and no live link to the lakehouse, and the export links expire.
- Unity Catalog and Purview lineage are described in the architecture notes as next steps. Neither was built.
- The failure alert fired in Azure Monitor on the intentional failure. Delivery of the alert email was not verified.
- Shortcuts forced by a trial subscription: storage-key access from Databricks, single-node clusters, and services placed across regions. A production design would use managed identity access and co-locate them.
- Azure Data Factory
- ADLS Gen2
- Azure Databricks
- PySpark
- Apache Spark
- Delta Lake
- Delta MERGE
- Medallion architecture
- Data quality gates
- Power BI
- Azure Monitor
- Log Analytics
- Bicep
- pytest