nerdexam
Microsoft

DP-420 · Question #61

You need to create a .NET console app to manage data in the Azure Cosmos DB SQL API account. As a part of the procedure, you need to create a database. Which of the following method can you use to…

The correct answer is D. CreateDatabaseAsync. A database is the logical container of items that are partitioned across containers. Either the CreateDatabaseAsync or CreateDatabaseIfNotExistsAsync method of the CosmosClient class can be used to create a database. Option A is incorrect. BuildDatabaseAsync is not a valid…

Integrate an Azure Cosmos DB solution

Question

You need to create a .NET console app to manage data in the Azure Cosmos DB SQL API account. As a part of the procedure, you need to create a database. Which of the following method can you use to create a database?

Options

  • ABuildDatabaseAsync
  • BCreateCosmosDatabase
  • CCreateContainerAsync
  • DCreateDatabaseAsync

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    5% (1)
  • D
    90% (18)

Explanation

A database is the logical container of items that are partitioned across containers. Either the CreateDatabaseAsync or CreateDatabaseIfNotExistsAsync method of the CosmosClient class can be used to create a database. Option A is incorrect. BuildDatabaseAsync is not a valid method to create the database. Option B is incorrect. CreateCosmosDatabase won’t help in creating the database. Option C is incorrect. CreateContainerAsync method is used to create a container, not a Option D is correct. Either the CreateDatabaseAsync or CreateDatabaseIfNotExistsAsync method of the CosmosClient class can be used to create a database. https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-api-get-started

Topics

#Azure Cosmos DB#.NET SDK#Database creation#SQL API

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice