AZ-204 · Question #478
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 B. client = CosmosClient(endpoint, key). CosmosClient has to be created before you can do option A and C to create databases and execute requests. client = CosmosClient(endpoint, key) database_name = 'MyDatabase' database = client.create_database_if_not_exists(id=database_name) container_name = 'MyContainer' container…
Question
Options
- Adatabase_name = 'MyDatabase'
- Bclient = CosmosClient(endpoint, key)
- Ccontainer_name = 'MyContainer'
How the community answered
(38 responses)- A16% (6)
- B79% (30)
- C5% (2)
Explanation
CosmosClient has to be created before you can do option A and C to create databases and execute requests. client = CosmosClient(endpoint, key) database_name = 'MyDatabase' database = client.create_database_if_not_exists(id=database_name) container_name = 'MyContainer' container = database.create_container_if_not_exists( id=container_name, partition_key=PartitionKey(path="/lastName"), offer_throughput=400 )
Topics
Community Discussion
No community discussion yet for this question.