You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account.
You need to write a SQL query that will return multiple items. The solution must meet the following requirements:
• For each item returned, include the current Coordinated Universal Time (UTC) date and time, formatted as an ISO 8601 string.
• Minimize development effort.
What should you use?
A. a user-defined function
B. GetCurrentTimestamp()
C. GetCurrentDateTime()
D. DateTimePart()
Show Answer
Correct Answer: C
Explanation: Use GetCurrentDateTime(). It returns the current UTC date and time as an ISO 8601 string, requiring no custom formatting or user-defined function.
Question 22
You are designing an Azure Cosmos DB for NoSQL data model that will contain authors, books the authors have written, and reviews of the books.
You need to maintain referential integrity between entities by using server-side transactional support.
What is the largest scope of the transactions you can use?
A. items in the same container
B. a single item
C. items in the same database
D. items in the same logical partition
Show Answer
Correct Answer: D
Explanation: Azure Cosmos DB for NoSQL transactions, including transactional batches and stored procedures, are scoped to items in the same logical partition. They cannot span logical partitions, even if those partitions are in the same container or database.
Question 23
You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that uses a default consistency level of Consistent Prefix.
You execute a SELECT query and specify the Consistent Prefix consistency level.
You need to execute a second SELECT query during the same session and specify a lower consistency level.
Which consistency level can be used for the second SELECT query?
A. Session
B. Strong
C. Bounded Staleness
D. Eventual
Show Answer
Correct Answer: D
Explanation: Eventual consistency is weaker than Consistent Prefix, so it can be specified for the second query. Session, Bounded Staleness, and Strong are stronger consistency levels.
Question 24
HOTSPOT
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account.
You create a container and assign the following indexing policy.
You run the queries shown in the following table.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Explanation: The composite index matches Query 1’s sort order and also supports Query 2’s sort order because both directions are reversed. Query 3’s filtered properties are not first in the composite index, so it cannot use that composite index for the combined filter and sort.
Question 25
DRAG DROP
You have an Azure Cosmos DB for NoSQL account.
You need to implement Always Encrypted for all the data stored in the account. The solution must minimize administrative effort.
At which level should you define the encryption policy and set the data encryption key? To answer, drag the appropriate levels to the correct requirements. Each level may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Show Answer
Correct Answer: Define the encryption policy: Container
Set the data encryption key: Database
Explanation: An encryption policy is defined for a container and identifies the properties to encrypt. The data encryption key is created at the database level and can be referenced by container policies.
Question 26
HOTSPOT
You have an Azure Cosmos DB for NoSQL database named db1.
You run the following code:
For each of the following statements, select Yes if the statements true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Show Answer
Correct Answer: 1. Yes
2. No
3. No
Explanation: A default TTL of -1 means items without their own TTL do not expire. An item can omit the partition-key property, customerId. An item-level TTL of 12 is measured in seconds, not days.
Question 27
You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely.
The following is a sample of the data.
You need to select a partition key that meets the following requirements for writes:
• Minimizes the partition skew
• Avoids capacity limits
• Avoids hot partitions
What should you do?
A. Create a new synthetic key that contains deviceId and timestamp.
B. Use timestamp as the partition key.
C. Use sensor1Value as the partition key.
D. Create a new synthetic key that contains deviceId and deviceManufacturer.
Show Answer
Correct Answer: A
Explanation: Use a synthetic partition key containing both deviceId and timestamp. The changing timestamp gives writes high key cardinality, distributing them across logical partitions rather than concentrating all devices’ writes on a timestamp-only key. Including time also avoids placing a device’s indefinitely retained data under one fixed device-based partition key, which could grow too large or become a hot partition.
Question 28
You have an Azure Cosmos DB for NoSQL account.
You configure the diagnostic settings to send all log information to a Log Analytics workspace.
You need to identify when the provisioned request units per second (RU/s) for resources within the account were modified.
You write the following query.
AzureDiagnostics
| where Category == "ControlPlaneRequests"
What should you include in the query?
A. | where OperationName startswith "SqlContainersCreate"
B. | where OperationName startswith "SqlContainersDelete"
C. | where OperationName startswith "SqlDatabasesThroughputUpdate"
D. | where OperationName startswith "AccountUpdateStart"
Show Answer
Correct Answer: C
Explanation: Filter for the control-plane operation that updates database throughput: `SqlDatabasesThroughputUpdate`. This identifies changes to provisioned RU/s.
Question 29
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account hosts a container named Container1.
At some point during the past 4S hours, Container1 was deleted.
You need to restore the account to immediately before the deletion of Container1. The solution must minimize administrative effort.
What should you do first?
A. Review the event feed blade.
B. Identify the last restorable timestamp.
C. Create a new Azure Cosmos DB for NoSQL account.
D. Restore Container1 to a different Azure Cosmos DB for NoSQL account.
Show Answer
Correct Answer: A
Explanation: Review the event feed first to find when Container1 was deleted. You can then choose a restore point immediately before that event. The last restorable timestamp might be after the deletion.
Sources:
https://learn.microsoft.com/en-us/azure/cosmos-db/continuous-backup-restore-resource-model
https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-restore-in-account-continuous-backup
Question 30
You have an Azure Cosmos DB for NoSQL container named Contained that has a provisioned throughput of 1,000 request units per second (RU/s). Contained is queried by using an app named App1.
Users of App1 report that several times a day, they receive the following error message: “HTTP error code 429”
You need to improve the reliability of App1 without affecting the performance of the app.
What are two ways to improve the reliability? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
A. Add a trigger to Container1.
B. Update App1 to split large requests into several smaller requests.
C. Update App1 to reduce the size of each request to less than 1 MB.
D. Increase the provisioned throughout of Container1.
E. Add retry logic to App1.
Show Answer
Correct Answer: D, E
Explanation: HTTP 429 indicates that requests are being throttled because they exceed the container’s provisioned RU/s. Increasing throughput provides more capacity, and retry logic—ideally honoring Cosmos DB’s retry-after delay—lets App1 recover from temporary throttling.
$19
Get all 177 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.