nerdexam
Microsoft

AZ-204 · Question #337

You develop Azure solutions. You must connect to a No-SQL globally-distributed database by using the .NET API. You need to create an object to configure and execute requests in the database. Which…

The correct answer is C. new CosmosClient(EndpointUri, PrimaryKey). Azure Cosmos DB is a fully managed NoSQL database for modern app development. Single-digit millisecond response times, and automatic and instant scalability, guarantee speed at any scale. // Create a new instance of the Cosmos Client this.cosmosClient = new…

Submitted by tom_us· Mar 30, 2026Develop for Azure storage

Question

You develop Azure solutions. You must connect to a No-SQL globally-distributed database by using the .NET API. You need to create an object to configure and execute requests in the database. Which code segment should you use?

Options

  • Anew Container(EndpointUri, PrimaryKey);
  • Bnew Database(Endpoint, PrimaryKey);
  • Cnew CosmosClient(EndpointUri, PrimaryKey);

How the community answered

(33 responses)
  • A
    9% (3)
  • B
    18% (6)
  • C
    73% (24)

Explanation

Azure Cosmos DB is a fully managed NoSQL database for modern app development. Single-digit millisecond response times, and automatic and instant scalability, guarantee speed at any scale. // Create a new instance of the Cosmos Client this.cosmosClient = new CosmosClient(EndpointUri, PrimaryKey) //ADD THIS PART TO YOUR CODE await this.CreateDatabaseAsync(); https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.cosmosclient?view=azure- https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started

Topics

#Cosmos DB#.NET SDK#CosmosClient#NoSQL

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice