AZ-204 – Question 42

0
1136
⚠️ Retired / Legacy Exam: This exam has been retired or replaced. These practice questions are kept for reference only. Please check the official vendor website for current exam versions before studying.
​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);
B. new Database(EndpointUri, PrimaryKey);
C. new CosmosClient(EndpointUri, PrimaryKey);

Correct Answer: C 

Example:
// Create a new instance of the Cosmos Client
this.cosmosClient = new CosmosClient(EndpointUri, PrimaryKey)
//ADD THIS PART TO YOUR CODE
await this.CreateDatabaseAsync();
Cloud Tech
Cloud Tech is a small, independent team that writes free practice questions for Microsoft Azure, AWS and CompTIA certification exams. We write every question ourselves against the current official exam outline, explain why each option is right or wrong, link to the vendor's documentation, and update or archive sets when an exam changes. Spotted a mistake? Email [email protected].