Tag: SQL Trigger Binding

Handle changes by using change event streaming (CES), change data capture (CDC), Change Tracking, Azure Functions with SQL trigger binding, or Azure Logic Apps (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Secure, optimize, and deploy database solutions (35–40%)
   --> Integrate SQL solutions with Azure services
      --> Handle changes by using change event streaming (CES), change data capture (CDC), Change Tracking, Azure Functions with SQL trigger binding, or Azure Logic Apps


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Modern applications rarely operate in isolation. A single database update often needs to trigger downstream actions such as updating search indexes, synchronizing data warehouses, refreshing caches, sending notifications, invoking APIs, or triggering AI pipelines.

Microsoft SQL Server and Azure SQL provide several mechanisms to detect and react to data changes. The DP-800 exam expects candidates to understand the capabilities, strengths, limitations, and appropriate use cases for each technology.

The primary technologies include:

  • Change Data Capture (CDC)
  • Change Tracking
  • Change Event Streaming (CES)
  • Azure Functions with SQL Trigger Binding
  • Azure Logic Apps

Understanding when and why to use each technology is more important than memorizing implementation details.


Why Change Detection Matters

Applications often need to know when data changes occur without continuously querying every table.

Examples include:

  • Synchronizing CRM and ERP systems
  • Triggering AI workflows after new customer data arrives
  • Updating recommendation engines
  • Refreshing search indexes
  • Sending order confirmation emails
  • Replicating data into Microsoft Fabric
  • Populating analytical data lakes
  • Updating Power BI semantic models

Without an efficient change detection mechanism, applications would have to repeatedly scan entire tables, resulting in:

  • Poor performance
  • Increased costs
  • Higher latency
  • Unnecessary resource utilization

Overview of Available Technologies

TechnologyDetects InsertsUpdatesDeletesProvides Changed ValuesTypical Use
Change TrackingYesYesYesNoLightweight synchronization
Change Data CaptureYesYesYesYesETL and replication
Change Event StreamingYesYesYesEvent streamEvent-driven architectures
Azure Functions SQL TriggerYesYesYesCurrent rowServerless processing
Azure Logic AppsYesYesYesDepends on connectorWorkflow automation

Change Data Capture (CDC)

What is CDC?

Change Data Capture records every data modification that occurs within selected database tables.

Unlike Change Tracking, CDC stores:

  • The type of operation
  • Before and after values (where applicable)
  • Transaction information
  • Log Sequence Numbers (LSNs)
  • Timestamps

CDC reads changes directly from the SQL Server transaction log instead of requiring application modifications.


How CDC Works

  1. User modifies data.
  2. SQL writes changes to the transaction log.
  3. CDC captures the changes.
  4. Changes are written into CDC system tables.
  5. Applications or ETL tools read the captured changes.
Application
SQL Table
Transaction Log
CDC Capture Process
CDC Change Tables
ETL / Azure Data Factory / Fabric

Information Stored by CDC

For every change, CDC stores:

  • Insert
  • Update
  • Delete
  • Transaction sequence
  • Changed columns
  • Original values
  • New values
  • Commit time
  • Log sequence number

This provides a complete history of modifications.


Advantages of CDC

Minimal application changes

Applications continue performing normal INSERT, UPDATE, and DELETE operations.


Incremental processing

Instead of processing millions of rows:

Yesterday:
10 million rows
Today:
Only 1,250 rows changed
CDC processes only 1,250 rows.

This dramatically improves ETL performance.


Supports Historical Analysis

CDC retains detailed change history.

Example:

Customer Name

Original:

John Smith

Updated:

John A. Smith

CDC preserves both versions.


Common CDC Use Cases

  • Azure Data Factory incremental loads
  • Microsoft Fabric ingestion
  • Data warehouse updates
  • Database replication
  • AI training pipelines
  • Audit solutions
  • Event publishing
  • Synchronizing microservices

Limitations

CDC:

  • Uses additional storage
  • Requires SQL Agent jobs (SQL Server)
  • Introduces some overhead
  • Retention must be managed
  • Generates additional transaction log activity

Change Tracking

What is Change Tracking?

Change Tracking is a lightweight feature that records which rows have changed, but does not store the actual changed values.

Instead, it stores metadata indicating:

  • Row changed
  • Row deleted
  • Version number

Applications retrieve the latest row directly from the table.


How Change Tracking Works

Instead of saving old values:

CustomerID 101 changed.

The application retrieves:

SELECT *
FROM Customers
WHERE CustomerID = 101

Only the current version is available.


Advantages

Very lightweight.

Minimal storage.

Minimal performance impact.

Simple synchronization.

Fast processing.


Limitations

Cannot determine:

Old value

New value

Only knows:

Row changed

No historical audit.

No before-and-after comparison.


Best Use Cases

Mobile synchronization

Offline applications

Client synchronization

Web applications

Caching

Incremental refresh

Applications only needing current data


CDC vs Change Tracking

FeatureCDCChange Tracking
Detect InsertsYesYes
Detect UpdatesYesYes
Detect DeletesYesYes
Stores Old ValuesYesNo
Stores New ValuesYesNo
Historical DataYesNo
Storage UsageHigherLower
ETL FriendlyExcellentLimited
SynchronizationGoodExcellent
AuditingExcellentPoor

Choosing Between CDC and Change Tracking

Choose CDC when:

  • Building ETL pipelines
  • Loading data warehouses
  • Creating audit systems
  • Tracking complete history
  • AI model retraining
  • Replication

Choose Change Tracking when:

  • Synchronizing mobile devices
  • Synchronizing applications
  • Detecting row changes only
  • Performance is critical
  • History is unnecessary

Change Event Streaming (CES)

What is Change Event Streaming?

Change Event Streaming is an event-driven approach that publishes database changes as events immediately after they occur.

Instead of applications polling for changes:

Did anything change?
Did anything change?
Did anything change?

The database immediately emits an event.


Event-Driven Architecture

INSERT Order
Database
Event Published
┌────┼────┐
▼ ▼ ▼
Function
Logic App
Service Bus

One database change can notify many downstream services simultaneously.


Advantages

Near real-time processing

Low latency

Highly scalable

Excellent for cloud-native applications

Supports asynchronous processing

Works well with event hubs and messaging systems


Common Scenarios

Order processing

Inventory updates

Recommendation engines

AI pipelines

Search indexing

Notifications

Microservices

IoT

Streaming analytics


Benefits over Polling

Polling example:

Check database every minute

Potential issues:

  • Delayed processing
  • Unnecessary database queries
  • Higher compute costs

Event streaming:

Change occurs
Immediate notification

Much more efficient.


Azure Functions with SQL Trigger Binding

Overview

Azure Functions provide a serverless compute platform capable of automatically executing code when database changes occur.

SQL Trigger Binding enables Azure Functions to react to SQL data modifications without requiring custom polling logic.

Typical workflow:

Database Change
SQL Trigger
Azure Function
Business Logic

Common Scenarios

Automatically:

  • Send emails
  • Generate invoices
  • Update search indexes
  • Invoke AI models
  • Call REST APIs
  • Update Cosmos DB
  • Write to Azure Storage
  • Publish Service Bus messages

Benefits

Serverless

Automatic scaling

Pay only for executions

Minimal infrastructure management

Easy integration with Azure services

Supports event-driven architectures


Example Scenario

A customer places an order.

INSERT Orders

The SQL trigger starts an Azure Function.

The function:

  • Validates inventory
  • Sends confirmation email
  • Updates recommendation engine
  • Notifies shipping
  • Publishes event

No manual polling required.


Azure Logic Apps

What Are Logic Apps?

Azure Logic Apps are low-code workflow automation services that integrate SQL databases with hundreds of Microsoft and third-party services.

Rather than writing custom code, workflows are built visually.

Example:

SQL Row Updated
Logic App
Teams Notification
Outlook Email
SharePoint Update
CRM Update

Common SQL Integrations

SQL Server

Azure SQL Database

Microsoft Dataverse

Dynamics 365

Salesforce

Microsoft Teams

SharePoint

Azure Storage

Azure Service Bus

Azure Event Grid

Power Automate


Typical Workflow

Customer Created
Logic App
Create CRM Record
Send Welcome Email
Create Help Desk Ticket
Notify Sales Team

Advantages

Low-code

Rapid development

Hundreds of connectors

Visual designer

Built-in retry policies

Error handling

Scheduling

Monitoring

Enterprise integration


Limitations

Logic Apps are ideal for orchestration and workflow automation but are not intended for high-throughput transactional processing where custom code or event streaming solutions may provide better scalability and lower latency.


Choosing the Right Technology

RequirementRecommended Solution
Incremental ETLCDC
Data Warehouse LoadingCDC
Audit HistoryCDC
Mobile SyncChange Tracking
Cache RefreshChange Tracking
Event-Driven ProcessingChange Event Streaming
Serverless Business LogicAzure Functions SQL Trigger
Workflow AutomationAzure Logic Apps
AI Pipeline TriggerAzure Functions or CES
Multi-System IntegrationLogic Apps

Best Practices

Enable Only What You Need

Enable CDC or Change Tracking only on tables that require change detection.


Monitor Storage

CDC tables can grow quickly.

Implement retention policies and cleanup jobs.


Prefer Event-Driven Architectures

Avoid continuous polling whenever possible.

Use:

  • CES
  • Azure Functions
  • Event Grid
  • Service Bus

for scalable cloud-native applications.


Separate Operational and Analytical Workloads

Use CDC to move transactional data into analytical platforms instead of querying production systems directly.


Secure Integration Endpoints

Protect Azure Functions and Logic Apps using:

  • Microsoft Entra ID
  • Managed identities
  • Azure Key Vault
  • Least privilege access
  • Network restrictions where appropriate

Monitor Reliability

Track:

  • Failed executions
  • Retry attempts
  • Dead-letter queues
  • Function failures
  • Logic App run history
  • Event delivery failures

DP-800 Exam Tips

Remember these common exam distinctions:

  • CDC records complete data changes, including inserted, updated, and deleted values, making it ideal for ETL, auditing, and replication.
  • Change Tracking records only that a row changed, making it a lightweight solution for synchronization scenarios.
  • Change Event Streaming supports near real-time, event-driven architectures by publishing change events to downstream consumers.
  • Azure Functions with SQL Trigger Binding are best when database changes should execute custom serverless code automatically.
  • Azure Logic Apps are the preferred choice for orchestrating business workflows and integrating SQL databases with Azure and third-party services through low-code connectors.
  • When selecting a technology, evaluate latency requirements, scalability, historical tracking needs, operational overhead, and integration requirements rather than choosing a single solution for every scenario.

Summary

Modern SQL applications extend well beyond traditional databases, serving as event sources for cloud-native architectures, AI pipelines, analytics platforms, and business workflows. Microsoft provides several complementary technologies to detect and process database changes, each optimized for different scenarios.

For the DP-800 exam, you should understand not only how these technologies work, but also when to choose one over another. CDC excels at incremental ETL and auditing, Change Tracking offers lightweight synchronization, Change Event Streaming enables real-time event-driven systems, Azure Functions execute custom business logic in response to changes, and Azure Logic Apps simplify workflow automation across enterprise services.

A solid understanding of these tools will help you design scalable, maintainable, and performant AI-enabled database solutions in Azure.


Practice Exam Questions


Question 1

A company loads data from an Azure SQL Database into a Microsoft Fabric warehouse every hour. The ETL process should retrieve only rows that have changed since the previous load, including the previous and new values of updated rows.

Which technology should you recommend?

A. Change Tracking

B. Change Data Capture (CDC)

C. Azure Logic Apps

D. Azure Functions with SQL Trigger Binding

Correct Answer: B

Explanation

CDC is specifically designed for incremental data movement scenarios. It captures inserts, updates, and deletes directly from the transaction log and stores detailed information about each change, including before and after values where applicable.

Why the other options are incorrect:

  • A: Change Tracking identifies changed rows but does not store previous values.
  • C: Logic Apps orchestrate workflows but do not capture database changes.
  • D: Azure Functions respond to events but are not intended to maintain historical change data for ETL.

Question 2

A mobile application periodically synchronizes customer records with an Azure SQL Database. The application only needs to know which rows have changed since the last synchronization and does not require historical values.

Which feature is most appropriate?

A. Change Event Streaming

B. Azure Functions SQL Trigger

C. Change Tracking

D. CDC

Correct Answer: C

Explanation

Change Tracking is optimized for synchronization scenarios. It records that rows have changed while minimizing storage and processing overhead.

Why the other options are incorrect:

  • A: CES is designed for event-driven architectures.
  • B: Azure Functions execute custom code rather than maintaining synchronization metadata.
  • D: CDC stores detailed change history, which is unnecessary here.

Question 3

An online retailer wants every new order inserted into the Orders table to immediately trigger inventory updates, shipping notifications, and fraud detection.

Which solution best supports this requirement?

A. Scheduled polling queries

B. Change Tracking

C. Change Event Streaming (CES)

D. Nightly ETL jobs

Correct Answer: C

Explanation

CES enables near real-time event publishing whenever database changes occur. Multiple downstream systems can subscribe to the same event without repeatedly querying the database.

Why the other options are incorrect:

  • A: Polling introduces unnecessary latency and database load.
  • B: Change Tracking is intended for synchronization rather than event processing.
  • D: Nightly ETL introduces unacceptable delays.

Question 4

A database update should automatically execute custom C# code that calls several REST APIs and writes audit information to Azure Storage.

Which Azure service should you recommend?

A. Azure Functions with SQL Trigger Binding

B. CDC

C. Change Tracking

D. SQL Agent Job

Correct Answer: A

Explanation

Azure Functions with SQL Trigger Binding automatically execute custom code when qualifying database changes occur, making them ideal for serverless business logic.

Why the other options are incorrect:

  • B: CDC records changes but does not execute code.
  • C: Change Tracking simply records row modifications.
  • D: SQL Agent jobs rely on scheduled execution rather than event-driven processing.

Question 5

Which statement correctly compares Change Tracking and Change Data Capture?

A. CDC captures complete change history while Change Tracking records only that rows changed.

B. Change Tracking captures previous values while CDC does not.

C. Both features store identical information.

D. CDC only tracks INSERT operations.

Correct Answer: A

Explanation

CDC stores detailed information about every change, including inserts, updates, deletes, timestamps, and transaction metadata. Change Tracking only identifies which rows have changed.

The remaining options are incorrect because they reverse the capabilities or incorrectly describe CDC.


Question 6

A business analyst wants to automate the following workflow without writing custom code:

  • Detect a new customer record.
  • Send an Outlook email.
  • Post a Microsoft Teams notification.
  • Update a SharePoint list.

Which solution is the best choice?

A. CDC

B. Azure Logic Apps

C. Change Tracking

D. SQL CLR

Correct Answer: B

Explanation

Azure Logic Apps provide low-code workflow automation with hundreds of built-in connectors, making them ideal for orchestrating business processes across Microsoft services.

Why the other options are incorrect:

  • A: CDC captures changes but does not automate workflows.
  • C: Change Tracking only records modified rows.
  • D: SQL CLR requires custom coding and is not intended for cloud workflow automation.

Question 7

A development team currently polls the database every minute to determine whether new records have been inserted.

What is the primary disadvantage of this design?

A. It reduces database normalization.

B. It prevents indexing.

C. It increases transaction isolation.

D. It generates unnecessary database workload and introduces latency.

Correct Answer: D

Explanation

Polling repeatedly queries the database even when no changes exist, increasing resource consumption while delaying event processing.

Event-driven solutions such as CES or Azure Functions eliminate this inefficiency.


Question 8

Which technology is most appropriate when an organization must maintain a complete historical record of all row changes for regulatory auditing?

A. Azure Logic Apps

B. Change Tracking

C. Change Data Capture

D. Azure Functions

Correct Answer: C

Explanation

CDC preserves detailed information about inserts, updates, deletes, transaction sequence numbers, and timestamps, making it ideal for compliance and auditing.

The other technologies either automate workflows or identify changes without preserving historical values.


Question 9

Which feature is specifically intended to minimize synchronization overhead by storing only metadata about changed rows?

A. Azure Functions SQL Trigger

B. Change Tracking

C. Change Event Streaming

D. Azure Event Grid

Correct Answer: B

Explanation

Change Tracking records lightweight metadata that indicates which rows have changed, allowing applications to retrieve only the latest row versions.

The other options serve different purposes:

  • Azure Functions execute code.
  • CES publishes events.
  • Event Grid distributes events but does not track database modifications.

Question 10

A solution architect is selecting a technology for an event-driven microservices architecture. Multiple independent services must react immediately whenever product inventory changes.

Which solution best satisfies this requirement?

A. Nightly ETL processing

B. Change Tracking

C. Database polling every five minutes

D. Change Event Streaming (CES)

Correct Answer: D

Explanation

CES is designed for event-driven systems where multiple subscribers consume database change events in near real time. It minimizes latency and reduces unnecessary database queries.

Why the other options are incorrect:

  • A: Nightly processing is far too slow.
  • B: Change Tracking is intended for synchronization rather than event broadcasting.
  • C: Polling introduces unnecessary workload and delays.

Exam Tips

For the DP-800 exam, remember these key distinctions:

  • Change Data Capture (CDC) is best for incremental ETL, auditing, replication, and historical change tracking.
  • Change Tracking is designed for lightweight synchronization when only the fact that a row changed is needed.
  • Change Event Streaming (CES) enables near real-time event-driven architectures by publishing database changes to downstream consumers.
  • Azure Functions with SQL Trigger Binding are ideal for executing custom serverless code in response to database changes.
  • Azure Logic Apps provide low-code workflow automation for integrating Azure SQL with Microsoft and third-party services.
  • On the exam, Microsoft often presents multiple technologies that could work. Choose the one that best aligns with the business requirement, considering factors such as latency, historical tracking, automation, scalability, and operational overhead, rather than selecting the most feature-rich option.

Go to the DP-800 Exam Prep Hub main page

Choose an embedding maintenance method, including table triggers, Change Tracking, Azure Functions with SQL trigger binding, Azure Logic Apps, CDC, CES, and Microsoft Foundry – Part 1 (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Implement AI capabilities in database solutions (25–30%)
   --> Design and implement models and embeddings
      --> Choose an embedding maintenance method, including table triggers, Change Tracking, Azure Functions with SQL trigger binding, Azure Logic Apps, CDC, CES, and Microsoft Foundry


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

One of the most important aspects of building AI-enabled database applications is maintaining the accuracy of vector embeddings. Embeddings represent the semantic meaning of data at a specific point in time. Whenever the underlying source data changes, the associated embeddings may become outdated. If stale embeddings remain in a vector index, semantic search, Retrieval-Augmented Generation (RAG), recommendation engines, and AI assistants can produce inaccurate or misleading results.

For the DP-800 exam, candidates should understand the various methods available to detect changes to relational data and automatically regenerate embeddings. Microsoft SQL Server 2025 and Azure SQL provide several mechanisms to detect data changes, each with different tradeoffs in performance, scalability, complexity, and latency.

The exam focuses on selecting the most appropriate embedding maintenance strategy based on business requirements.


What Is Embedding Maintenance?

Embedding maintenance is the process of keeping vector embeddings synchronized with the underlying relational data.

Whenever data changes, one or more of the following actions may be required:

  • Generate a new embedding.
  • Replace the old embedding.
  • Update the vector index.
  • Remove deleted vectors.
  • Refresh search indexes.

Without proper maintenance, semantic search quality gradually degrades.


Why Embedding Maintenance Is Important

Suppose a product catalog contains this description:

“Wireless Bluetooth Noise-Cancelling Headphones”

An embedding is generated from that description.

Later, the product description changes to:

“Wireless Bluetooth Noise-Cancelling Headphones with Spatial Audio and USB-C Fast Charging”

If the embedding is not regenerated:

  • AI searches may not return the product.
  • Vector similarity decreases.
  • RAG answers become outdated.
  • Recommendation quality drops.

Keeping embeddings synchronized ensures AI applications remain accurate.


Common Embedding Maintenance Workflow

Most embedding maintenance solutions follow this lifecycle:

User Updates SQL Data
Change Detection
Generate New Embedding
Store Updated Vector
Refresh Vector Search Index

The primary difference between maintenance methods is how they detect changes.


Choosing the Right Maintenance Strategy

Microsoft provides several approaches:

MethodTypical LatencyComplexityBest For
Table TriggersImmediateLowSmall databases
Change TrackingLowMediumIncremental synchronization
Change Data Capture (CDC)MediumMediumETL and analytics
Azure Functions SQL TriggerNear real-timeMediumEvent-driven cloud apps
Azure Logic AppsNear real-timeLowLow-code automation
Change Event Streaming (CES)Real-timeHighStreaming architectures
Microsoft Foundry PipelinesScheduled or event-drivenMediumAI data pipelines

Table Triggers

What Are They?

Table triggers automatically execute SQL code whenever data changes.

Example events include:

  • INSERT
  • UPDATE
  • DELETE

Triggers provide immediate notification that data has changed.


Embedding Workflow Using Triggers

UPDATE Product
Trigger Executes
Identify Changed Row
Queue Embedding Job

The trigger usually should not generate the embedding itself because AI model inference may take several seconds.

Instead, the trigger inserts a work item into a processing queue.


Advantages

  • Immediate detection
  • Simple implementation
  • Works entirely within SQL
  • No polling required

Disadvantages

  • Can increase transaction duration
  • Poor choice for expensive AI operations
  • May reduce OLTP performance
  • Difficult to scale for very high transaction volumes

Best Practice

Use triggers only to record changes—not to call AI models directly.


Change Tracking

What Is Change Tracking?

Change Tracking is a lightweight SQL Server feature that records which rows have changed without recording every individual data modification.

Applications periodically retrieve changed rows and regenerate only affected embeddings.


Workflow

Application
Read Change Tracking
Changed Rows
Generate Embeddings
Update Vector Table

Advantages

  • Lightweight
  • Low storage overhead
  • Incremental processing
  • Excellent for synchronization

Limitations

  • Does not capture previous values
  • Does not store complete history
  • Requires periodic polling

Best Use Cases

  • RAG applications
  • Semantic search
  • Incremental embedding refresh
  • Azure SQL synchronization

Change Data Capture (CDC)

What Is CDC?

Change Data Capture records detailed information about every change made to a table.

It captures:

  • Inserts
  • Updates
  • Deletes
  • Previous values
  • New values
  • Log sequence numbers (LSNs)

CDC reads the SQL transaction log rather than relying on triggers.


Workflow

Transaction Log
CDC Tables
Embedding Pipeline
Vector Updates

Advantages

  • Complete history
  • High reliability
  • Efficient large-scale processing
  • Ideal for ETL

Disadvantages

  • More storage than Change Tracking
  • Higher administrative overhead
  • Not truly instantaneous

Best Use Cases

  • Enterprise ETL
  • Large databases
  • Historical auditing
  • Batch embedding refresh

Comparing Change Tracking and CDC

FeatureChange TrackingCDC
Tracks changed rowsYesYes
Stores previous valuesNoYes
Transaction log basedNoYes
Full historyNoYes
Storage overheadLowMedium
SynchronizationExcellentExcellent
AuditingLimitedExcellent

Azure Functions with SQL Trigger Binding

Azure Functions provide serverless compute that automatically executes code when SQL data changes.

Instead of polling SQL continuously, the SQL trigger binding reacts to data modifications.

Typical workflow:

SQL Change
Azure Function
Generate Embedding
Store Vector

Advantages

  • Serverless
  • Automatic scaling
  • Pay-per-execution
  • Near real-time processing
  • Excellent Azure integration

Best Use Cases

  • Cloud-native AI applications
  • Azure SQL Database
  • RAG systems
  • Intelligent search solutions

Azure Logic Apps

Azure Logic Apps provide a low-code workflow engine.

Instead of writing custom code, developers configure workflows visually.

Typical workflow:

SQL Change
Logic App Trigger
Call Azure OpenAI
Update Embedding Table

Advantages

  • Low-code development
  • Hundreds of built-in connectors
  • Easy integration with Azure services
  • Fast implementation

Limitations

  • Less flexible than custom code
  • Higher latency than Azure Functions
  • Complex workflows can become difficult to maintain

Best Use Cases

  • Business automation
  • Small AI workflows
  • Rapid prototyping
  • Citizen developers

Choosing Between Triggers, Change Tracking, CDC, Azure Functions, and Logic Apps

ScenarioRecommended Method
Small OLTP databaseTable Trigger + Queue
Incremental synchronizationChange Tracking
Historical auditingCDC
Serverless AI processingAzure Functions
Low-code workflowAzure Logic Apps

DP-800 Exam Tips (Part 1)

Remember these key points for the exam:

  • Triggers provide immediate notification but should not directly perform expensive AI inference.
  • Change Tracking records which rows changed and is optimized for lightweight synchronization.
  • CDC captures detailed change history and is ideal for enterprise ETL and auditing.
  • Azure Functions with SQL trigger binding enable scalable, serverless, event-driven embedding generation.
  • Azure Logic Apps offer a low-code approach for automating embedding workflows with Azure services.
  • Select the maintenance method based on the required balance of latency, scalability, operational complexity, and business requirements.

Go to the DP-800 Exam Prep Hub main page

Choose an embedding maintenance method, including table triggers, Change Tracking, Azure Functions with SQL trigger binding, Azure Logic Apps, CDC, CES, and Microsoft Foundry – Part 2 (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Implement AI capabilities in database solutions (25–30%)
   --> Design and implement models and embeddings
      --> Choose an embedding maintenance method, including table triggers, Change Tracking, Azure Functions with SQL trigger binding, Azure Logic Apps, CDC, CES, and Microsoft Foundry


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Change Event Streaming (CES)

What Is Change Event Streaming?

Change Event Streaming (CES) is an event-driven architecture that publishes database changes as a continuous stream of events. Instead of periodically polling the database for updates, applications subscribe to events as they occur.

In AI-enabled database solutions, CES enables embeddings to be regenerated almost immediately after data changes, making it well suited for near real-time AI applications.

Typical event streaming technologies include:

  • Azure Event Hubs
  • Azure Service Bus
  • Apache Kafka-compatible services
  • Microsoft Fabric Eventstreams
  • Azure Event Grid (for certain event-driven scenarios)

Although the underlying messaging technology can vary, the goal remains the same: publish changes once and allow multiple downstream consumers to react independently.


CES Workflow

Application Updates Product
Database Change Event
Event Stream
Embedding Service
Generate New Embedding
Update Vector Table
Refresh Vector Index

Unlike triggers, the database transaction completes first before downstream processing begins.


Advantages of CES

Near Real-Time Processing

Embeddings are regenerated within seconds instead of waiting for scheduled synchronization jobs.


Loose Coupling

The database does not directly invoke AI services.

Instead:

Database → Event Stream → AI Service

Each component evolves independently.


Scalability

Multiple consumers can process the same event stream simultaneously.

Examples include:

  • Embedding generation
  • Analytics
  • Notifications
  • Data warehouse loading
  • Audit logging

Reliability

Most event streaming platforms support:

  • Message durability
  • Retry policies
  • Dead-letter queues
  • Checkpointing
  • Replay capability

Limitations of CES

CES introduces additional infrastructure.

Organizations must manage:

  • Event brokers
  • Message retention
  • Consumer groups
  • Retry policies
  • Monitoring
  • Event ordering
  • Duplicate message handling

Consequently, CES is best suited to enterprise-scale systems rather than small departmental applications.


Best Use Cases for CES

CES is particularly appropriate for:

  • Large AI-powered search platforms
  • High-volume ecommerce catalogs
  • Recommendation engines
  • Enterprise RAG applications
  • Distributed microservices
  • Real-time personalization
  • AI copilots
  • Event-driven architectures

Microsoft Foundry for Embedding Maintenance

What Is Microsoft Foundry?

Microsoft Foundry (Azure AI Foundry) provides an end-to-end platform for building, evaluating, orchestrating, and managing AI applications.

Within embedding maintenance scenarios, Foundry can orchestrate the entire embedding lifecycle, including:

  • Detecting changes
  • Invoking embedding models
  • Validating outputs
  • Updating vector stores
  • Monitoring AI workloads
  • Managing model versions

Instead of writing custom orchestration code, developers can leverage Foundry pipelines and workflows.


Foundry Workflow

SQL Database
Change Detection
Foundry Pipeline
Embedding Model
Vector Generation
Azure SQL Vector Column
Vector Search

Advantages of Microsoft Foundry

Centralized AI Management

Developers manage:

  • Models
  • Prompts
  • Pipelines
  • Evaluations
  • Monitoring

within a unified environment.


Model Flexibility

Foundry supports many foundation models, including:

  • OpenAI GPT models
  • Phi models
  • Llama models
  • Mistral
  • Cohere
  • Other supported models

This flexibility allows organizations to switch models without redesigning their database architecture.


Integrated Evaluation

Foundry provides tools to evaluate:

  • Response quality
  • Latency
  • Cost
  • Safety
  • Groundedness
  • Hallucination rates

These capabilities help organizations choose the most appropriate embedding model over time.


Choosing the Appropriate Embedding Maintenance Method

The DP-800 exam expects candidates to recommend the most suitable approach for a given scenario.

Scenario 1

A small inventory system updates only a few records each day.

Recommended solution:

Table Trigger + Background Queue

Reason:

Simple implementation with minimal infrastructure.


Scenario 2

An ecommerce application updates thousands of products every hour.

Recommended solution:

Change Tracking

Reason:

Incremental synchronization with low overhead.


Scenario 3

A financial organization requires complete auditing of every database modification.

Recommended solution:

Change Data Capture (CDC)

Reason:

Captures historical values and detailed change information.


Scenario 4

A cloud-native AI chatbot must update embeddings immediately after documents change.

Recommended solution:

Azure Functions with SQL Trigger Binding

Reason:

Serverless, scalable, near real-time processing.


Scenario 5

A business analyst wants to automate embedding generation without writing code.

Recommended solution:

Azure Logic Apps

Reason:

Visual workflow designer with numerous connectors.


Scenario 6

A global ecommerce platform updates millions of products continuously.

Recommended solution:

Change Event Streaming (CES)

Reason:

Highly scalable event-driven architecture.


Scenario 7

An enterprise AI team manages multiple models and complex AI workflows.

Recommended solution:

Microsoft Foundry

Reason:

Centralized orchestration, evaluation, and lifecycle management.


Hybrid Architectures

Many enterprise solutions combine multiple technologies.

Example:

Azure SQL Database
Change Tracking
Azure Function
Azure OpenAI Embedding Model
Vector Table
Azure AI Search

Or

CDC
Event Hub
Microsoft Foundry Pipeline
Embedding Generation
Azure SQL Vector Store

Hybrid solutions often provide the best balance between scalability, reliability, and operational simplicity.


Performance Considerations

When designing an embedding maintenance strategy, consider:

Latency

How quickly must embeddings be updated?

  • Seconds
  • Minutes
  • Hours
  • Overnight

Volume

How many records change?

  • Hundreds
  • Thousands
  • Millions

Cost

Real-time updates generally cost more than scheduled batch updates because they invoke AI services more frequently.


Reliability

Determine how failures are handled.

Best practices include:

  • Retry policies
  • Dead-letter queues
  • Logging
  • Checkpointing
  • Idempotent processing (safe repeated execution)

Scalability

Solutions should scale horizontally without affecting OLTP performance.

Avoid placing expensive AI inference directly inside database transactions.


Security Considerations

Embedding maintenance processes should follow Microsoft security recommendations.

Authentication

Prefer:

  • Managed Identity
  • Microsoft Entra ID

Avoid hardcoded API keys whenever possible.


Secret Storage

Store credentials in:

  • Azure Key Vault

Do not embed secrets in:

  • SQL scripts
  • Stored procedures
  • Source code
  • Configuration files checked into source control

Least Privilege

Embedding services should receive only the permissions required to:

  • Read source data
  • Generate embeddings
  • Update vector columns

Common Mistakes

Many candidates incorrectly assume:

❌ Triggers should directly call AI models.

Instead:

✔ Triggers should enqueue work.


❌ CDC and Change Tracking are identical.

Instead:

✔ CDC stores detailed history.

✔ Change Tracking stores lightweight synchronization information.


❌ Real-time processing is always best.

Instead:

✔ Choose the solution that balances latency, complexity, scalability, and cost.


❌ Azure Logic Apps are intended only for business workflows.

Instead:

✔ Logic Apps can orchestrate AI-powered embedding updates using Azure connectors.


DP-800 Exam Tips

For the exam, remember the following associations:

RequirementRecommended Solution
Immediate notificationTable Trigger
Lightweight synchronizationChange Tracking
Full audit historyCDC
Serverless event processingAzure Functions
Low-code automationAzure Logic Apps
Massive real-time streamingChange Event Streaming (CES)
AI orchestration and lifecycle managementMicrosoft Foundry

Also remember:

  • Triggers are appropriate for detecting changes, but expensive AI operations should execute outside the transaction.
  • Change Tracking is optimized for incremental synchronization with minimal overhead.
  • CDC is best when historical change information is required.
  • Azure Functions provide scalable, event-driven embedding generation.
  • Azure Logic Apps are ideal for low-code integration workflows.
  • CES supports highly scalable, distributed, event-driven architectures.
  • Microsoft Foundry centralizes AI model management, orchestration, evaluation, and monitoring.

Key Takeaways

Choosing the right embedding maintenance strategy is essential for ensuring that vector representations remain synchronized with relational data. The optimal solution depends on business requirements for latency, scalability, complexity, cost, and governance. Smaller systems may benefit from triggers or Change Tracking, while enterprise AI applications often use Azure Functions, CES, or Microsoft Foundry to automate embedding generation at scale. Understanding the strengths and tradeoffs of each option is a key objective of the DP-800 certification exam.


Practice Exam Questions


Question 1

A company stores product descriptions in Azure SQL Database and generates vector embeddings for semantic search. Product descriptions change only a few times per week, and the company wants a lightweight mechanism to identify modified rows before regenerating embeddings.

Which feature should be recommended?

A. Change Tracking

B. AFTER UPDATE triggers

C. SQL Agent Jobs

D. Transaction Replication

Correct Answer: A

Explanation

Change Tracking records which rows have changed with minimal overhead, making it ideal for periodically identifying records whose embeddings need regeneration.

Why the other answers are incorrect:

  • B: Triggers execute synchronously and increase transaction time.
  • C: SQL Agent is not available in Azure SQL Database.
  • D: Replication is intended for data synchronization, not change detection for AI workflows.

Question 2

A financial services company must regenerate embeddings immediately after a customer profile changes because AI-powered recommendations must always reflect the latest data.

Which maintenance approach best satisfies this requirement?

A. Nightly batch processing

B. Azure Logic Apps scheduled every hour

C. AFTER INSERT and UPDATE table triggers

D. Weekly CDC processing

Correct Answer: C

Explanation

Table triggers execute immediately after data modifications, making them suitable when embeddings must remain synchronized with transactional data.

Why the other answers are incorrect:

  • A: Introduces unacceptable latency.
  • B: Scheduled workflows are not immediate.
  • D: CDC is asynchronous.

Question 3

A retailer updates millions of inventory records daily. Embedding generation is computationally expensive, and the organization wants processing to occur asynchronously without affecting transaction performance.

Which architecture is the best choice?

A. Table triggers that call Azure OpenAI directly

B. Change Data Capture combined with Azure Functions

C. Manual nightly exports

D. Recursive stored procedures

Correct Answer: B

Explanation

CDC captures database changes asynchronously, while Azure Functions can process those changes independently to generate embeddings.

Why the other answers are incorrect:

  • A: External service calls should not occur inside triggers.
  • C: Manual exports are inefficient.
  • D: Stored procedures are not designed for event-driven processing.

Question 4

A company wants a low-code solution that automatically updates embeddings whenever new documents are added while integrating with Azure AI services.

Which service should be recommended?

A. SQL CLR

B. Azure Kubernetes Service

C. Azure Logic Apps

D. SQL Replication

Correct Answer: C

Explanation

Azure Logic Apps provide low-code workflow automation and easily integrate SQL Database with Azure AI services.

Why the other answers are incorrect:

  • A: CLR is unsupported in Azure SQL Database.
  • B: AKS is unnecessary for simple workflows.
  • D: Replication does not generate embeddings.

Question 5

A global retailer wants multiple downstream applications—including AI pipelines, analytics systems, and notification services—to receive database change events independently.

Which technology is best suited?

A. SQL Agent

B. Change Event Streaming (CES)

C. Table triggers

D. Dynamic Data Masking

Correct Answer: B

Explanation

CES publishes change events that multiple consumers can process independently, making it ideal for scalable event-driven architectures.

Why the other answers are incorrect:

  • A: SQL Agent is scheduler-based.
  • C: Triggers execute only within the database transaction.
  • D: Dynamic Data Masking is unrelated.

Question 6

An organization wants a centralized AI platform that manages embedding generation, model lifecycle, monitoring, governance, and orchestration across multiple databases.

Which solution best meets these requirements?

A. Microsoft Foundry

B. SQL Server Agent

C. Azure Backup

D. Elastic Query

Correct Answer: A

Explanation

Microsoft Foundry provides enterprise AI orchestration, governance, monitoring, and centralized management of embedding workflows.

Why the other answers are incorrect:

  • B: SQL Agent schedules jobs only.
  • C: Azure Backup is unrelated.
  • D: Elastic Query supports distributed querying, not AI orchestration.

Question 7

A company stores thousands of product descriptions in an Azure SQL Database. New rows are added every few hours, while updates to existing descriptions are relatively rare. The organization wants an efficient solution that minimizes database overhead while identifying only rows that require regenerated embeddings.

Which approach should be recommended?

A. Enable Change Tracking and periodically process changed rows.

B. Create AFTER INSERT and AFTER UPDATE triggers that immediately regenerate embeddings.

C. Rebuild embeddings for every record every night.

D. Disable change detection and regenerate embeddings manually.

Correct Answer: A

Explanation

Change Tracking records which rows have changed without capturing full before-and-after values, making it lightweight and well suited for identifying documents requiring updated embeddings.

Why the other answers are incorrect:

  • B: Triggers increase transaction duration.
  • C: Full regeneration wastes resources.
  • D: Manual processes are unsuitable for production.

Question 8

A development team uses Azure SQL Database and wants embedding generation to occur automatically whenever qualifying data changes. The solution should require minimal infrastructure management while supporting serverless execution.

Which option best meets these requirements?

A. SQL Agent jobs

B. Azure Logic Apps with a daily recurrence trigger

C. Azure Functions using SQL trigger binding

D. Manual PowerShell execution

Correct Answer: C

Explanation

Azure Functions with SQL trigger binding provide event-driven, serverless processing that reacts automatically to SQL changes.

Why the other answers are incorrect:

  • A: SQL Agent is unavailable in Azure SQL Database.
  • B: Polling introduces unnecessary latency.
  • D: Manual execution is not scalable.

Question 9

A company has implemented Microsoft Foundry to orchestrate its AI workloads. Multiple databases contribute documents that require embeddings, and administrators want centralized orchestration, monitoring, and model lifecycle management.

Which embedding maintenance approach is most appropriate?

A. Table triggers on every database

B. Change Tracking only

C. Microsoft Foundry orchestration

D. Manual nightly SQL scripts

Correct Answer: C

Explanation

Microsoft Foundry provides centralized orchestration for AI pipelines, including embedding generation, monitoring, governance, and model management.

Why the other answers are incorrect:

  • A: Triggers do not provide orchestration.
  • B: Change Tracking only detects changes.
  • D: Manual scripts do not scale well.

Question 10

An organization maintains embeddings for customer support articles. The business requires that embedding updates remain resilient even if the external AI model becomes temporarily unavailable. Failed requests should be retried without affecting database transactions.

Which architecture best satisfies these requirements?

A. Generate embeddings inside SQL table triggers.

B. Use an asynchronous event-driven process such as CDC or CES combined with Azure Functions or Microsoft Foundry.

C. Regenerate every embedding immediately within the user transaction.

D. Require users to manually regenerate embeddings after every update.

Correct Answer: B

Explanation

An asynchronous architecture decouples database transactions from AI processing. Failed embedding generation requests can be retried without impacting database writes, improving resiliency and scalability.

Why the other answers are incorrect:

  • A: External service failures may block transactions.
  • C: Tightly coupling AI services to transactions reduces reliability.
  • D: Manual updates are inefficient and error-prone.

Go to the DP-800 Exam Prep Hub main page