Question 340 of 881
AZ-204 Develop Azure compute solutions Practice Question
You are developing a serverless application using Azure Functions. The function must process messages from an Azure Storage Queue and write results to Azure Cosmos DB. Which binding should you use for the output?
⚠ Common exam trap
A common mix-up: candidates confuse input and output bindings, selecting the Cosmos DB input binding (Option B) because they see 'Cosmos DB' and forget the direction, or choose the Blob Storage binding (Option A) because they associate storage with output without reading the requirement for Cosmos DB.
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
✓
Azure Cosmos DB output binding
The Azure Cosmos DB output binding allows you to write the results of queue-triggered function execution directly to a Cosmos DB container. The function processes messages from an Azure Storage Queue (input binding) and uses the output binding to insert or upsert documents into Cosmos DB without writing any SDK code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Azure Blob Storage output binding
Why it's wrong here
An Azure Blob Storage output binding is designed to write binary or text data as blobs into Azure Blob Storage containers. While it's an effective way to store files, images, or logs, it is fundamentally incompatible with the requirement to persist structured data into an Azure Cosmos DB database. This binding cannot directly interact with or write documents to a Cosmos DB collection, as it targets a different storage service and data model.
- ✗
Azure Cosmos DB input binding
Why it's wrong here
An Azure Cosmos DB input binding is used to retrieve one or more documents from an Azure Cosmos DB collection based on parameters passed to the function, such as an ID or a SQL query. Its purpose is to read existing data into the function for processing, not to create, update, or delete documents within the Cosmos DB database. Therefore, it cannot fulfill the requirement of writing new data to Cosmos DB.
- ✗
Azure Storage Queue output binding
Why it's wrong here
An Azure Storage Queue output binding is specifically engineered to send messages to an Azure Storage Queue, facilitating asynchronous communication between different components of a distributed system. This binding's sole function is to enqueue messages, making it unsuitable for directly persisting structured data as documents into an Azure Cosmos DB collection. It operates on a different service and data model entirely, serving a messaging rather than a document storage purpose.
- ✓
Azure Cosmos DB output binding
Why this is correct
The Azure Cosmos DB output binding is the correct choice because it is specifically designed to write new documents or update existing ones within an Azure Cosmos DB collection directly from an Azure Function. This binding handles the underlying connection and data serialization, allowing the function to output a C# object, JavaScript object, or array of objects that are then automatically persisted as JSON documents into the specified Cosmos DB database and collection.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, 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 →
Last reviewed: Jun 24, 2026
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.
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.
Sign in to join the discussion.