nerdexam
Microsoft

DP-420 · Question #115

You develop an application that uses Azure Cosmos DB Core (SQL) API. You create an Azure pipeline to build and deploy the application. You need to change the pipeline to run integration tests that…

The correct answer is B. an Azure Cosmos DB Emulator task. To run integration tests for an Azure Cosmos DB application entirely within an Azure pipeline without external dependencies, you should add an Azure Cosmos DB Emulator task.

Integrate an Azure Cosmos DB solution

Question

You develop an application that uses Azure Cosmos DB Core (SQL) API. You create an Azure pipeline to build and deploy the application. You need to change the pipeline to run integration tests that you wrote for the application. The solution must execute entirely in the pipeline. What should you add to the pipeline?

Options

  • Aa deployment group named Cosmos DB testing
  • Ban Azure Cosmos DB Emulator task
  • Ca NuGet service connection that uses an Azure Cosmos DB API key
  • Da secret variable that has a connection string to an Azure Cosmos DB database

How the community answered

(30 responses)
  • A
    7% (2)
  • B
    77% (23)
  • C
    3% (1)
  • D
    13% (4)

Why each option

To run integration tests for an Azure Cosmos DB application entirely within an Azure pipeline without external dependencies, you should add an Azure Cosmos DB Emulator task.

Aa deployment group named Cosmos DB testing

A deployment group is used for deploying applications to target machines, not for running a local Cosmos DB instance for integration testing within the pipeline itself.

Ban Azure Cosmos DB Emulator taskCorrect

The Azure Cosmos DB Emulator task allows integration tests to run entirely within the pipeline by providing a local in-memory or on-disk emulation of the Cosmos DB service. This eliminates the need for a live Cosmos DB account, making tests self-contained and faster.

Ca NuGet service connection that uses an Azure Cosmos DB API key

A NuGet service connection is for accessing NuGet packages, not for providing an in-pipeline Cosmos DB instance or its credentials.

Da secret variable that has a connection string to an Azure Cosmos DB database

While a connection string is needed to connect to Cosmos DB, using a secret variable with a connection string implies connecting to a live Cosmos DB database, which violates the requirement of executing "entirely in the pipeline" for testing without external dependencies.

Concept tested: Azure Cosmos DB Emulator for pipeline integration testing

Source: https://learn.microsoft.com/en-us/azure/cosmos-db/emulator

Topics

#Azure Pipelines#Integration Testing#Cosmos DB Emulator#CI/CD

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice