microsoft dp-420 practice test

Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB (beta)

Note: Test Case questions are at the end of the exam
Last exam update: Jul 20 ,2024
Page 1 out of 3. Viewing questions 1-15 out of 51

Question 1 Topic 3, Mixed Questions

You plan to create an Azure Cosmos DB Core (SQL) API account that will use customer-managed keys stored in Azure Key
Vault.
You need to configure an access policy in Key Vault to allow Azure Cosmos DB access to the keys.
Which three permissions should you enable in the access policy? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  • A. Wrap Key
  • B. Get
  • C. List
  • D. Update
  • E. Sign
  • F. Verify
  • G. Unwrap Key
Answer:

A B G

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
F
50%
G
50%

Explanation:
To Configure customer-managed keys for your Azure Cosmos account with Azure Key Vault: Add an access policy to your
Azure Key Vault instance:
1. From the Azure portal, go to the Azure Key Vault instance that you plan to use to host your encryption keys. Select
Access Policies from the left menu:

2. Select + Add Access Policy.
3. Under the Key permissions drop-down menu, select Get, Unwrap Key, and Wrap Key permissions:

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-setup-cmk

Discussions
vote your answer:
A
B
C
D
E
F
G
0 / 1000

Question 2 Topic 3, Mixed Questions

HOTSPOT
You have an Azure Cosmos DB Core (SQL) API account named account1.
You have the Azure virtual networks and subnets shown in the following table.

The vnet1 and vnet2 networks are connected by using a virtual network peer.
The Firewall and virtual network settings for account1 are configured as shown in the exhibit.

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:

Answer:

Explanation:
Box 1: Yes
VM1 is on vnet1.subnet1 which has the Endpoint Status enabled.
Box 2: No
Only virtual network and their subnets added to Azure Cosmos account have access. Their peered VNets cannot access the
account until the subnets within peered virtual networks are added to the account.
Box 3: No
Only virtual network and their subnets added to Azure Cosmos account have access.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-vnet-service-endpoint

Discussions
0 / 1000

Question 3 Topic 3, Mixed Questions

HOTSPOT
You have a database in an Azure Cosmos DB SQL API Core (SQL) account that is used for development.
The database is modified once per day in a batch process.
You need to ensure that you can restore the database if the last batch process fails. The solution must minimize costs.
How should you configure the backup settings? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Answer:

Discussions
0 / 1000

Question 4 Topic 3, Mixed Questions

You have the following query.
SELECT * FROM
WHERE c.sensor = "TEMP1"
AND c.value < 22
AND c.timestamp >= 1619146031231
You need to recommend a composite index strategy that will minimize the request units (RUs) consumed by the query.
What should you recommend?

  • A. a composite index for (sensor ASC, value ASC) and a composite index for (sensor ASC, timestamp ASC)
  • B. a composite index for (sensor ASC, value ASC, timestamp ASC) and a composite index for (sensor DESC, value DESC, timestamp DESC)
  • C. a composite index for (value ASC, sensor ASC) and a composite index for (timestamp ASC, sensor ASC)
  • D. a composite index for (sensor ASC, value ASC, timestamp ASC)
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
If a query has a filter with two or more properties, adding a composite index will improve performance.
Consider the following query:
SELECT * FROM c WHERE c.name = Tim and c.age > 18
In the absence of a composite index on (name ASC, and age ASC), we will utilize a range index for this query. We can
improve the efficiency of this query by creating a composite index for name and age.
Queries with multiple equality filters and a maximum of one range filter (such as >,<, <=, >=, !=) will utilize the composite
index.
Reference: https://azure.microsoft.com/en-us/blog/three-ways-to-leverage-composite-indexes-in-azure-cosmos-db/

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5 Topic 3, Mixed Questions

HOTSPOT
You have a container named container1 in an Azure Cosmos DB Core (SQL) API account.
The following is a sample of a document in container1.
{
"studentId": "631282",
"firstName": "James",
"lastName": "Smith",
"enrollmentYear": 1990,
"isActivelyEnrolled": true,
"address": {
"street": "",
"city": "",
"stateProvince": "",
"postal": "",
}
}
The container1 container has the following indexing policy.
{
"indexingMode": "consistent",
"includePaths": [
{
"path": "/*"
},
{
"path": "/address/city/?"
}
],
"excludePaths": [
{
"path": "/address/*"
},
{
"path": "/firstName/?"
}
]
}
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:

Answer:

Explanation:
Box 1: Yes
"path": "/*" is in includePaths.
Include the root path to selectively exclude paths that don't need to be indexed. This is the recommended approach as it lets
Azure Cosmos DB proactively index any new property that may be added to your model.
Box 2: No
"path": "/firstName/?" is in excludePaths.
Box 3: Yes
"path": "/address/city/?" is in includePaths
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/index-policy

Discussions
0 / 1000

Question 6 Topic 3, Mixed Questions

You have a container named container1 in an Azure Cosmos DB Core (SQL) API account. Upserts of items in container1
occur every three seconds.
You have an Azure Functions app named function1 that is supposed to run whenever items are inserted or replaced in
container1.
You discover that function1 runs, but not on every upsert.
You need to ensure that function1 processes each upsert within one second of the upsert.
Which property should you change in the Function.json file of function1?

  • A. checkpointInterval
  • B. leaseCollectionsThroughput
  • C. maxItemsPerInvocation
  • D. feedPollDelay
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
With an upsert operation we can either insert or update an existing record at the same time.
FeedPollDelay: The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all
current changes are drained. Default is 5,000 milliseconds, or 5 seconds.
Incorrect Answers:
A: checkpointInterval: When set, it defines, in milliseconds, the interval between lease checkpoints. Default is always after
each Function call.
C: maxItemsPerInvocation: When set, this property sets the maximum number of items received per Function call. If
operations in the monitored collection are performed through stored procedures, transaction scope is preserved when
reading items from the change feed. As a result, the number of items received could be higher than the specified value so
that the items changed by the same transaction are returned as part of one atomic batch.
Reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7 Topic 3, Mixed Questions

HOTSPOT
You have the indexing policy shown in the following exhibit.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in
the graphic.
NOTE: Each correct selection is worth one point.
Hot Area:

Answer:

Explanation:
Box 1: ORDER BY c.name DESC, c.age DESC
Queries that have an ORDER BY clause with two or more properties require a composite index.
The following considerations are used when using composite indexes for queries with an ORDER BY clause with two or
more properties:
If the composite index paths do not match the sequence of the properties in the ORDER BY clause, then the composite

index can't support the query. The order of composite index paths (ascending or descending) should also match the order

in the ORDER BY clause. The composite index also supports an ORDER BY clause with the opposite order on all paths.

Box 2: At the same time as the item creation
Azure Cosmos DB supports two indexing modes:
Consistent: The index is updated synchronously as you create, update or delete items. This means that the consistency of

your read queries will be the consistency configured for the account. None: Indexing is disabled on the container.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/index-policy

Discussions
0 / 1000

Question 8 Topic 3, Mixed Questions

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 a container named container1 in an Azure Cosmos DB Core (SQL) API account.
You need to make the contents of container1 available as reference data for an Azure Stream Analytics job.
Solution: You create an Azure function that uses Azure Cosmos DB Core (SQL) API change feed as a trigger and Azure
event hub as the output.
Does this meet the goal?

  • A. Yes
  • B. No
Answer:

A

User Votes:
A
50%
B
50%

Explanation:
The Azure Cosmos DB change feed is a mechanism to get a continuous and incremental feed of records from an Azure
Cosmos container as those records are being created or modified. Change feed support works by listening to container for
any changes. It then outputs the sorted list of documents that were changed in the order in which they were modified.
The following diagram represents the data flow and components involved in the solution:

Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/changefeed-ecommerce-solution

Discussions
vote your answer:
A
B
0 / 1000

Question 9 Topic 3, Mixed Questions

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 a container named container1 in an Azure Cosmos DB Core (SQL) API account.
You need to make the contents of container1 available as reference data for an Azure Stream Analytics job.
Solution: You create an Azure Data Factory pipeline that uses Azure Cosmos DB Core (SQL) API as the input and Azure
Blob Storage as the output.
Does this meet the goal?

  • A. Yes
  • B. No
Answer:

B

User Votes:
A
50%
B
50%

Explanation:
Instead create an Azure function that uses Azure Cosmos DB Core (SQL) API change feed as a trigger and Azure event hub
as the output.
The Azure Cosmos DB change feed is a mechanism to get a continuous and incremental feed of records from an Azure
Cosmos container as those records are being created or modified. Change feed support works by listening to container for
any changes. It then outputs the sorted list of documents that were changed in the order in which they were modified.
The following diagram represents the data flow and components involved in the solution:

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/changefeed-ecommerce-solution

Discussions
vote your answer:
A
B
0 / 1000

Question 10 Topic 3, Mixed Questions

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 a container named container1 in an Azure Cosmos DB Core (SQL) API account.
You need to make the contents of container1 available as reference data for an Azure Stream Analytics job.
Solution: You create an Azure Synapse pipeline that uses Azure Cosmos DB Core (SQL) API as the input and Azure Blob
Storage as the output.
Does this meet the goal?

  • A. Yes
  • B. No
Answer:

B

User Votes:
A
50%
B
50%

Explanation:
Instead create an Azure function that uses Azure Cosmos DB Core (SQL) API change feed as a trigger and Azure event hub
as the output.
The Azure Cosmos DB change feed is a mechanism to get a continuous and incremental feed of records from an Azure
Cosmos container as those records are being created or modified. Change feed support works by listening to container for
any changes. It then outputs the sorted list of documents that were changed in the order in which they were modified.
The following diagram represents the data flow and components involved in the solution:

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/changefeed-ecommerce-solution

Discussions
vote your answer:
A
B
0 / 1000

Question 11 Topic 3, Mixed Questions

HOTSPOT
You configure Azure Cognitive Search to index a container in an Azure Cosmos DB Core (SQL) API account as shown in the
following exhibit.

Use the drop-down menus to select the answer choice that completes each statement based on the information presented in
the graphic.
NOTE: Each correct selection is worth one point.
Hot Area:

Answer:

Explanation:
Box 1: country
The country field is filterable.
Note: filterable: Indicates whether to enable the field to be referenced in $filter queries. Filterable differs from searchable in
how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo lexical
analysis, so comparisons are for exact matches only.
Box 2: name
The name field is not Retrievable.
Retrievable: Indicates whether the field can be returned in a search result. Set this attribute to false if you want to use a field
(for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user.
Note: searchable: Indicates whether the field is full-text searchable and can be referenced in search queries.
Reference: https://docs.microsoft.com/en-us/rest/api/searchservice/create-index

Discussions
0 / 1000

Question 12 Topic 3, Mixed Questions

HOTSPOT
You have three containers in an Azure Cosmos DB Core (SQL) API account as shown in the following table.

You have the following Azure functions:
A function named Fn1 that reads the change feed of cn1

A function named Fn2 that reads the change feed of cn2

A function named Fn3 that reads the change feed of cn3

You perform the following actions:
Delete an item named item1 from cn1.

Update an item named item2 in cn2.

For an item named item3 in cn3, update the item time to live to 3,600 seconds.

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:

Answer:

Explanation:
Box 1: No
Azure Cosmos DB's change feed is a great choice as a central data store in event sourcing architectures where all data
ingestion is modeled as writes (no updates or deletes).
Note: The change feed does not capture deletes. If you delete an item from your container, it is also removed from the
change feed. The most common method of handling this is adding a soft marker on the items that are being deleted. You
can add a property called "deleted" and set it to "true" at the time of deletion. This document update will show up in the
change feed. You can set a TTL on this item so that it can be automatically deleted later.
Box 2: No
The _etag format is internal and you should not take dependency on it, because it can change anytime.
Box 3: Yes
Change feed support in Azure Cosmos DB works by listening to an Azure Cosmos container for any changes.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/change-feed-design-patterns https://docs.microsoft.com/en-
us/azure/cosmos-db/change-feed

Discussions
0 / 1000

Question 13 Topic 3, Mixed Questions

The following is a sample of a document in orders.

The orders container uses customerId as the partition key.
You need to provide a report of the total items ordered per month by item type. The solution must meet the following
requirements:
Ensure that the report can run as quickly as possible. Minimize the consumption of request units (RUs).


What should you do?

  • A. Configure the report to query orders by using a SQL query.
  • B. Configure the report to query a new aggregate container. Populate the aggregates by using the change feed.
  • C. Configure the report to query orders by using a SQL query through a dedicated gateway.
  • D. Configure the report to query a new aggregate container. Populate the aggregates by using SQL queries that run daily.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
You can facilitate aggregate data by using Change Feed and Azure Functions, and then use it for reporting.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14 Topic 3, Mixed Questions

You have an Azure Cosmos DB Core (SQL) API account that uses a custom conflict resolution policy. The account has a
registered merge procedure that throws a runtime exception.
The runtime exception prevents conflicts from being resolved.
You need to use an Azure function to resolve the conflicts.
What should you use?

  • A. a function that pulls items from the conflicts feed and is triggered by a timer trigger
  • B. a function that receives items pushed from the change feed and is triggered by an Azure Cosmos DB trigger
  • C. a function that pulls items from the change feed and is triggered by a timer trigger
  • D. a function that receives items pushed from the conflicts feed and is triggered by an Azure Cosmos DB trigger
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
The Azure Cosmos DB Trigger uses the Azure Cosmos DB Change Feed to listen for inserts and updates across partitions.
The change feed publishes inserts and updates, not deletions.
Reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15 Topic 3, Mixed Questions

The settings for a container in an Azure Cosmos DB Core (SQL) API account are configured as shown in the following
exhibit.

Which statement describes the configuration of the container?

  • A. All items will be deleted after one year.
  • B. Items stored in the collection will be retained always, regardless of the items time to live value.
  • C. Items stored in the collection will expire only if the item has a time to live value.
  • D. All items will be deleted after one hour.
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
When DefaultTimeToLive is -1 then your Time to Live setting is On (No default)
Time to Live on a container, if present and the value is set to "-1", it is equal to infinity, and items dont expire by default.
Time to Live on an item:
This Property is applicable only if DefaultTimeToLive is present and it is not set to null for the parent container.
If present, it overrides the DefaultTimeToLive value of the parent container.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/time-to-live

Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2