ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 71 - AZ-204 discussion

Report
Export

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?

A.
new Container(EndpointUri, PrimaryKey);
Answers
A.
new Container(EndpointUri, PrimaryKey);
B.
new Database(EndpointUri, PrimaryKey);
Answers
B.
new Database(EndpointUri, PrimaryKey);
C.
new CosmosClient(EndpointUri, PrimaryKey);
Answers
C.
new CosmosClient(EndpointUri, PrimaryKey);
Suggested answer: C

Explanation:

Example:

// Create a new instance of the Cosmos Client

this.cosmosClient = new CosmosClient(EndpointUri, PrimaryKey)

//ADD THIS PART TO YOUR CODE

await this.CreateDatabaseAsync();

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started

asked 02/10/2024
Ages Handriyanto
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first