The full answer
Put automated checks at each stage of the pipeline (on arrival, during transformation and before publishing), decide for each check whether a failure stops the run, quarantines rows or only warns, and track the results over time so problems surface before users find them.
1. Profile and set expectations Profile the sources to learn their normal shape. Microsoft Purview Unified Catalog offers data profiling and no-code data quality rules with scores per data asset, data product and governance domain, which gives a shared view across teams.
2. Checks on arrival (ingestion)
- Schema: are the expected columns and types present? In mapping data flows, schema drift settings let you detect new columns and alert rather than silently pass them through.
- Completeness: row counts compared with the source or with recent loads; required fields not null.
- Freshness: did today's file arrive on time?
- Unreadable records go to a quarantine folder with the reason, not into the lake.
3. Checks during transformation
- Business rules: amounts positive, status values from a known list, dates in range, keys unique.
- Referential integrity: every order's customer exists.
- On Azure Databricks, Lakeflow declarative pipelines (formerly Delta Live Tables) declare these as expectations:
from pyspark import pipelines as dp
@dp.table
@dp.expect_or_drop("valid_amount", "amount > 0")
@dp.expect_or_fail("has_order_id", "order_id IS NOT NULL")
def clean_orders():
return spark.readStream.table("raw_orders")
expect keeps bad rows and records them, expect_or_drop removes them, and expect_or_fail stops the update. The pipeline's event log keeps the pass and fail counts.
4. Checks before publishing
- Reconcile totals (row counts, sums of amounts) between source and target.
- Compare today's volume with the recent average to catch partial loads.
5. Monitoring and alerting
- Data Factory sends pipeline and activity run metrics to Azure Monitor; set alerts on failures and on custom quality metrics written to Log Analytics.
- Show quality results in a dashboard per table, so trends are visible, not only failures.
6. Make it part of engineering
- Unit tests for transformation code, rules kept in version control, and data contracts with source teams so schema changes are agreed before they happen.
Last updated 16 October 2026