Drag steps to the numbered slots on the right, or tap a step then tap a slot.
AZ-204 Develop Azure compute solutions Practice Question
Arrange the steps to implement Azure Functions with a Cosmos DB trigger in the correct order.
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
Create Cosmos DB, then create Function App, then add trigger binding, then write code, then test.
First create Cosmos DB, then Function App, add trigger binding, write code, test.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Create Cosmos DB, then create Function App, then add trigger binding, then write code, then test.
Why this is correct
This sequence is correct because establishing the Azure Cosmos DB account first provides the necessary resource for the Azure Function App to reference. The Function App is then created, followed by configuring the Cosmos DB trigger binding, which defines how the function will react to changes. Writing the function code comes next, implementing the logic based on the trigger's input, and finally, testing validates the entire integration.
- ✗
Create Function App, then create Cosmos DB, then add trigger binding, then write code, then test.
Why it's wrong here
This order is incorrect because the Azure Cosmos DB trigger binding, a core component of the Azure Function, requires an existing Cosmos DB account and its connection string to be properly configured. Creating the Function App before Cosmos DB means the necessary database and collection details for the trigger would not yet exist, preventing the binding from being correctly established.
- ✗
Create Cosmos DB, then create Function App, then write code, then add trigger binding, then test.
Why it's wrong here
This order is incorrect because the trigger binding must be defined before writing the function code. The Cosmos DB trigger binding dictates the function's signature, including the specific input parameters (e.g., `IReadOnlyList<Document> documents`) and attributes like `[CosmosDBTrigger(...)]`. Writing code without this established signature would lead to compilation errors or a function that cannot correctly receive data from the change feed.
- ✗
Create Cosmos DB, then create Function App, then add trigger binding, then test, then write code.
Why it's wrong here
This order is incorrect because testing an Azure Function's integration with Cosmos DB requires the function's code to be fully written, deployed, and operational. Attempting to test before the code is implemented means there is no logic to execute or observe, making any form of functional validation impossible. Code must always precede testing in the development lifecycle.
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 |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Durable Functions
Durable Functions is an extension of Azure Functions that lets you write stateful workflows in code, managing complex sequences of tasks, retries, and delays automatically.
Key term
Azure Functions Bindings
Azure Functions Bindings are declarative connections that link your serverless function code to Azure services or external resources, handling input and output data automatically without writing extra networking or authentication code.
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 →
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.