Launch Deal · 50% off 1st month ·

2.8 — Azure Monitor and Handling Data Changes

DP-800 Domain 2 · Skill 2.8

What You Need to Know

Production SQL solutions need observability (Azure Monitor) and a reliable way to react when data changes, for example to refresh embeddings, sync caches or feed analytics. DP-800 lists five change-handling options. Know when each one fits.

Monitoring with Azure Monitor

Component Use it for
Platform metrics CPU, data I/O, log I/O, DTU or vCore use, storage, connections, deadlocks. Set metric alerts on them
Diagnostic settings → Log Analytics Resource logs (Query Store runtime statistics, errors, blocks, deadlocks, timeouts, wait statistics, audit) sent to a workspace for KQL queries, workbooks and log alerts
Application Insights Application-side telemetry: request durations, dependency calls to SQL (with the query and duration), failures and distributed traces
Database watcher Managed, near-real-time monitoring of Azure SQL estates, stored in Azure Data Explorer or Fabric

A typical recommendation: diagnostic settings for the database into Log Analytics, Application Insights in the app, and alerts on CPU, deadlocks and failed connections.

Ways to react to changes

Option What it captures Delivery Best for
Change Tracking Which rows changed (keys plus the type of operation), the net change since a version You pull with CHANGETABLE(CHANGES ...) Lightweight sync; it underpins the Azure Functions SQL trigger
Change data capture (CDC) Full row images (before and after) of every change, in change tables You pull from the CDC functions Auditing-style history; feeding ETL with every intermediate change
Change event streaming (CES) (preview) Row changes as CloudEvents (JSON or Avro) Pushed in near real time to Azure Event Hubs (and on to Fabric eventstreams) Event-driven architectures; many downstream consumers; no polling
Azure Functions SQL trigger binding Row changes (it uses Change Tracking under the covers) Runs your function code automatically Serverless reactions, such as generating an embedding for a changed row
Azure Logic Apps (SQL connector triggers) New or modified rows (by polling) Low-code workflow Business workflows: notify, approve, call other systems
Table trigger The rows in the statement (inserted, deleted) Synchronous, inside the transaction Small, fast, in-database rules. Never slow external calls

Setup snippets:

ALTER DATABASE CURRENT SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);
ALTER TABLE dbo.Product ENABLE CHANGE_TRACKING;     -- required by the Azure Functions SQL trigger

EXEC sys.sp_cdc_enable_db;
EXEC sys.sp_cdc_enable_table @source_schema = 'dbo', @source_name = 'Product', @role_name = NULL;

Choosing

  • "Refresh embeddings asynchronously when product descriptions change, without slowing writes" → Azure Functions SQL trigger (Change Tracking), CES or CDC. Not a table trigger that calls the model.
  • "Stream every change to several consumers in real time without polling" → CES to Event Hubs.
  • "Keep a complete history of every intermediate value for an ETL process" → CDC.
  • "Low-code business workflow when an order is inserted" → Logic Apps.

Key Concept: Change Tracking tells you which rows changed. CDC tells you what they looked like before and after. CES pushes changes as events. Functions and Logic Apps react to changes. Keep slow work out of synchronous triggers.

Exam Traps

  • Using Change Tracking when every intermediate value must be kept (it only has the net change)
  • Calling an embedding model from a table trigger (latency and failures inside user transactions)
  • Forgetting that the Azure Functions SQL trigger needs Change Tracking enabled on the database and the table
  • Using Application Insights to collect server-side Query Store data (that's diagnostic settings to Log Analytics)

Check your understanding

Practice Scenario

🔒 This practice scenario is part of Skillmarked Pro

The lessons stay free. Pro unlocks the other 14 DP-800 practice scenarios and the 50-question timed mock exam, plus everything for every other exam.

See plans

Launch Deal: first month €9.95, then €19.90/month. Enter code LAUNCH50 at checkout. Ends 1 December.

Cancel anytime. Or €199 a year, which saves 17%.

Not sure yet? Try 10 free mock exam questions.

Already Pro? Log in.