Courseiva
Develop Azure compute solutionsmediumDrag & DropObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

Arrange the steps to implement Azure Functions with a Cosmos DB trigger in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5

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

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.