Courseiva
Develop for Azure storagemediumMultiple ChoiceObjective-mapped

AZ-204 Develop for Azure storage Practice Question

You are designing a solution that needs to react to changes in an Azure Cosmos DB container in real-time. Whenever a new document is inserted or updated, a downstream service must be triggered to process the change. You want to build a serverless solution that reliably captures each change exactly once. Which Azure Cosmos DB feature should you use?

⚠ Common exam trap

Candidates often confuse Change feed with triggers, but triggers are synchronous and transactional, whereas Change feed provides an asynchronous, at-least-once (with idempotent handling) stream designed for event-driven architectures.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Change feed

The Change feed in Azure Cosmos DB is designed to capture document-level changes (inserts and updates) in the order they occur and provides an event-driven, serverless mechanism to reliably process each change exactly once. It integrates natively with Azure Functions, enabling real-time reactions without polling or custom tracking.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Stored procedures

    Why it's wrong here

    Azure Cosmos DB stored procedures are server-side JavaScript functions executed transactionally within a single partition key scope. While they allow complex logic and data manipulation, their primary purpose is to encapsulate database operations and ensure atomicity. They operate synchronously as part of a database transaction and lack the inherent capability to directly invoke external services or publish events for real-time, decoupled reactions to changes across the entire container.

  • T-SQL queries

    Why it's wrong here

    T-SQL queries, or more accurately, SQL API queries in Azure Cosmos DB, are declarative statements used to retrieve, filter, and project data from containers. These queries are pull-based operations, meaning they execute upon request to fetch the current state of data. They do not offer any mechanism for real-time, push-based notifications or event streams that would allow an external solution to automatically react to data modifications as they occur within the database.

  • Change feed

    Why this is correct

    The Azure Cosmos DB change feed provides a persistent, ordered, and sequential log of all item modifications within a container, including inserts, updates, and deletes. It acts as a durable event source, allowing external consumers, such as Azure Functions, to reliably read and process these changes in near real-time without impacting database performance. This push-based mechanism is ideal for building event-driven architectures that react to data changes for scenarios like data synchronization, materialized views, or triggering downstream processes.

  • Triggers

    Why it's wrong here

    Azure Cosmos DB triggers are server-side JavaScript functions that execute either before (pre-trigger) or after (post-trigger) a database operation on a single item. They run synchronously within the same transaction as the item modification, primarily for data validation or transformation. However, triggers are not designed for initiating external workflows or reacting to changes across an entire container, nor can they directly invoke external services in a decoupled, asynchronous manner suitable for event-driven solutions.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

Go deeper

Related to this question

About these practice questions

This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.