Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 86–90 (page: 19)

Updated On: 16-Nov-2026
View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB container named container1.
You need to insert an item into container1. The solution must ensure that the item is deleted automatically after two hours.
How should you complete the item definition? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: ttl
Example:
Create a container with TTL
Create an Azure Cosmos DB container with TTL enabled.
Open Cloudshell
# Create an Azure Cosmos DB container with TTL of one day resourceGroupName='myResourceGroup'
accountName='mycosmosaccount'
databaseName='database1'
containerName='container1'
az cosmosdb sql container update \
-g $resourceGroupName \
-a $accountName \
-d $databaseName \
-n $containerName \
--ttl=86400
Box 2: 7200
TTL is set in seconds.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/manage-with-cli#create-a-container-with-ttl



View Related Case Study

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have an Azure Cosmos DB for NoSQL account named account1 that uses autoscale throughput.
You need to run an Azure function when the normalized request units per second for a container in account1 exceeds a specific value.
Solution: You configure an Azure Monitor alert to trigger the function.
Does this meet the goal?

  1. Yes
  2. No

Answer(s): A

Explanation:

You can set up alerts from the Azure Cosmos DB pane or the Azure Monitor service in the Azure portal.
Note: Alerts are used to set up recurring tests to monitor the availability and responsiveness of your Azure Cosmos DB resources. Alerts can send you a notification in the form of an email, or execute an Azure Function when one of your metrics reaches the threshold or if a specific event is logged in the activity log.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/create-alerts



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account hosts a container named Container1 that stores product inventory data in the following format.

You need to query the average inventory quantity of each product in Washington, including the product name.
How should you complete the query? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: inventoryData.inventoryAverage
Action: Project the subquery result.
The subquery calculates the average and aliases it as inventory
Average. To output this value in the main SELECT clause, you must access it via the subquery's alias inventoryData.Value for inventoryData.inventoryAverage
Box 2: JOIN
Azure Cosmos DB uses the JOIN keyword to evaluate subqueries against arrays or flatten nested structures. Using JOIN properly binds inventoryData to each product row.


Reference:

https://medium.com/@Mbabakr/sql-essential-training-68f635f36b4c



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account contains a container named Container1 that stores product data and stock level information.
You need to implement a stored procedure that will accept the following parameters:
-productid productName initialStockLevel
The solution must create the following:
-An item that contains the product data
-An item that contains the stock level data of each product
How should you complete the stored procedure? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: getCollection()
Box 2: getSelfLink()
To create a stored procedure in Azure Cosmos DB for NoSQL that generates two separate items (product data and stock level) from three input parameters, use the following JavaScript code in the Azure Portal Data Explorer.
Stored Procedure Code in javascript:
function createInventoryItems(productid, productName, initialStockLevel) {
var context = getContext();
*-> var container = context.getCollection(); [Box 1]
var response = context.getResponse();
// 1. Define the Product Item var productItem = {
id: productid,
name: productName,
type: "product"
};
// 2. Define the Stock Level Item var stockItem = {
id: productid + "_stock",
productId: productid,
quantity: initialStockLevel,
type: "stock"
};
// 3. Create Product Item
*-> var accepted = container.createDocument(container.getSelfLink(), productItem, [Box 2]
function (err, itemCreated) {
if (err) throw new Error("Error creating product: " + err.message);
// 4. Create Stock Item (Nested Callback for Atomicity)
var acceptedStock = container.createDocument(container.getSelfLink(), stockItem,
function (err2, stockCreated) {
if (err2) throw new Error("Error creating stock: " + err2.message);
// Final response if both succeed response.setBody({ product: itemCreated, stock: stockCreated });
});
if (!acceptedStock) return;
});
if (!accepted) return;
}


Reference:

https://oneuptime.com/blog/post/2026-02-16-how-to-write-and-execute-stored-procedures-in-azure-cosmos-db /view



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You are creating a database in an Azure Cosmos DB for NoSQL account. The database will be used by an application that will provide users with the ability to share online posts. Users will also be able to submit comments on other users' posts.
You need to store the data shown in the following table.

The application has the following characteristics:
-Users can submit an unlimited number of posts.
-The average number of posts submitted by a user will be more than 1,000.
-Posts can have an unlimited number of comments from different users.
-The average number of comments per post will be 100, but many posts will exceed 1,000 comments.
-Users will be limited to having a maximum of 20 interests.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: Yes
Non-relational data increases write costs, but can decrease read costs.
Box 2: Yes
Non-relational data increases write costs, but can decrease read costs.
Box 3: No
Non-relational data increases write costs, but can decrease read costs.



Viewing page 19 of 61
Viewing questions 91 - 95 out of 296 questions


Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!