Courseiva
Question 207 of 881
Develop for Azure storagemediumMultiple ChoiceObjective-mapped

AZ-204 Develop for Azure storage Practice Question

A serverless app must react whenever audit documents are inserted or updated in Cosmos DB. Which trigger should the Azure Function use?

⚠ Common exam trap

It's easy for candidates to confuse the Cosmos DB trigger with a generic database trigger, forgetting that it specifically relies on the change feed and not on direct database events like stored procedures or triggers in SQL Server.

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

Cosmos DB trigger

The Azure Cosmos DB trigger listens to the change feed of a Cosmos DB container, which captures inserts and updates to documents. This makes it the ideal choice for reacting to audit document changes in a serverless app, as it automatically invokes the function when new or modified documents appear in the feed.

Answer analysis

Option-by-option breakdown

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

  • Queue trigger

    Why it's wrong here

    An Azure Functions Queue trigger is designed to activate a function whenever a new message is added to an Azure Storage Queue or Azure Service Bus Queue. It continuously polls the specified queue and processes messages in a FIFO manner. This trigger type is entirely decoupled from Cosmos DB's change feed mechanism and cannot directly monitor or react to document modifications within a Cosmos DB container, making it unsuitable for real-time data change detection.

  • Timer trigger

    Why it's wrong here

    An Azure Functions Timer trigger executes a function on a predefined, recurring schedule, specified using a CRON expression. While it could be configured to periodically query Cosmos DB for changes, it does not inherently leverage the real-time, push-based nature of the Cosmos DB change feed. This approach would introduce significant latency and require complex custom logic to track processed changes, making it inefficient for immediate reactions to data modifications.

  • HTTP trigger

    Why it's wrong here

    An HTTP trigger in Azure Functions makes a function callable via an HTTP request, acting as a standard web API endpoint. It waits for an external client to send an HTTP request (e.g., GET, POST) to its unique URL. This trigger type is entirely passive and cannot proactively monitor or react to internal data changes within a Cosmos DB container; it only responds when explicitly invoked by an external HTTP call, which is not the requirement here.

  • Cosmos DB trigger

    Why this is correct

    The Azure Cosmos DB trigger for Azure Functions is specifically engineered to listen for changes in an Azure Cosmos DB container's change feed. It automatically processes new inserts and updates (and optionally deletes, depending on configuration) in near real-time, invoking the function for each change. This trigger efficiently leverages the change feed processor library to manage leases and distribute processing across multiple function instances, ensuring reliable and scalable event-driven reactions to data modifications without polling.

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

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.