CertSafari

    Free Microsoft Azure Cosmos DB AI Developer Associate (DP-420) Sample Questions

    35 free sample questions from our bank of 349+, covering every exam domain, with answers and detailed explanations. Updated November 2026.

    1: Design and develop database solutions

    1.5: Design and implement Azure Cosmos DB solutions by using AI-assisted tools

    1.A developer without an Azure subscription wants to try the Agent Kit to review a sample data model on a laptop with Node.js installed. Which statement is correct?

    1. A.They must purchase a Microsoft Learn MCP license because skills only load after the documentation server authenticates.
    2. B.They can install the skills with npx and review code or a data model, since installation needs no Azure subscription.
    3. C.They cannot proceed until they create a Cosmos DB account, because installation registers the machine with the account.
    4. D.They must first sign in with Azure CLI so the skills CLI can download rule files from a private container registry.
    Show answer & explanation

    Correct answer: B — They can install the skills with npx and review code or a data model, since installation needs no Azure subscription.

    • A. The Learn MCP server is optional and separate; skills load without it and no license gates the kit.
    • B. Installing the skills and reviewing code require no subscription; only separate database tools need their own authentication.
    • C. Installation does not register anything with an account and needs no database to exist.
    • D. Rules come from the public GitHub repository, not from a private registry requiring Azure sign-in.

    1.1: Evaluate resource models and SDK solutions

    2.A container with autoscale maximum 20,000 RU/s returns 429 responses to clients, yet Azure Monitor shows Normalized RU Consumption averaging 20%. One physical partition sits at 100% while others are idle. Which two actions address the root cause?(Select 2)

    1. A.Convert the container to serverless capacity mode, which removes per-partition throughput limits and spreads each request across all partitions.
    2. B.Review the partition key for skew and move to a higher-cardinality key, such as a hierarchical or synthetic key, in a new container.
    3. C.Increase `MaxRetryAttemptsOnRateLimitedRequests` to 50 so the SDK keeps retrying until the hot partition has enough capacity to serve each request.
    4. D.Split Normalized RU Consumption by `PartitionKeyRangeId` to confirm that a single hot physical partition is the one being throttled.
    5. E.Raise the autoscale maximum to 100,000 RU/s so that every physical partition receives a larger share and the hot partition stops being throttled.
    Show answer & explanation

    Correct answers: B, D — Review the partition key for skew and move to a higher-cardinality key, such as a hierarchical or synthetic key, in a new container.; Split Normalized RU Consumption by `PartitionKeyRangeId` to confirm that a single hot physical partition is the one being throttled.

    • A. Serverless still enforces per-partition limits and cannot spread a single logical partition's load.
    • B. A hot logical partition is a data-model problem, so the lasting fix is a key that spreads requests evenly.
    • C. Extra retries only delay failures and add load on the hot partition; they do not fix the uneven distribution.
    • D. Throughput is divided across physical partitions, so one hot partition can throttle even when the container average is low. Splitting the metric by partition range confirms it.
    • E. More throughput adds cost and does not remove the skew; the hot key still concentrates requests on one partition and can still be throttled.

    1.3: Design and implement data models and partitioning strategies

    3.An e-commerce team models orders and line items. Each order has at most 20 line items, items are always displayed with their order, and line items are rarely queried alone. Which design best fits these access patterns?

    1. A.Store a document per line item that copies order header fields, with the container partitioned on `/lineItemId`
    2. B.Embed the line items as an array in each order document, with the container partitioned on `/orderId`
    3. C.Move line items to a second container, partitioned on `/productId`, and query it for each order
    4. D.Keep line items as separate documents that orders reference by id, with the container partitioned on `/customerId`
    Show answer & explanation

    Correct answer: B — Embed the line items as an array in each order document, with the container partitioned on `/orderId`

    • A. Incorrect. Items are always shown with their order, but partitioning on the line item id scatters one order's items across partitions, so displaying it needs a cross-partition query. Copying header fields onto every item also multiplies storage and update cost.
    • B. Correct. Each order has at most 20 items and they are read with their order, so embedding them is the natural fit. One point read returns the whole order, and a single-document write updates it atomically.
    • C. Incorrect. Cosmos DB for NoSQL cannot join across containers, so each order view takes extra queries in the application. Partitioning on the product id also spreads one order's items over many partitions, costing more RUs.
    • D. Incorrect. Showing an order means reading the order document and then fetching each item it references, which costs extra reads and RUs. The references must also be kept in step with the item documents, and with at most 20 items per order this adds no benefit.

    1.3: Design and implement data models and partitioning strategies

    4.Which TWO statements about hierarchical partition keys (HPKs) in Azure Cosmos DB for NoSQL are accurate?(Select 2)

    1. A.The hierarchy takes up to three paths, listed from the highest level to the lowest when the container is created
    2. B.Queries that filter on only the final path of the hierarchy are still served from a single physical partition
    3. C.A fourth level is possible by listing the item `id` as an extra path in the hierarchy when the container is created
    4. D.A container that already uses a single partition key can be moved to HPK by copying its data into a new container
    5. E.A hierarchical key can be added later by editing the partition key definition in the container's settings in the portal
    Show answer & explanation

    Correct answers: A, D — The hierarchy takes up to three paths, listed from the highest level to the lowest when the container is created; A container that already uses a single partition key can be moved to HPK by copying its data into a new container

    • A. Correct. HPK supports a maximum of three levels. The paths are given in order, from the top level down, when the container is created.
    • B. Incorrect. Efficient single-partition routing needs the leading levels in the filter. A query on only the last level omits them and fans out across the physical partitions.
    • C. Incorrect. The limit is three levels in total. The item `id` can occupy one of those three positions, but it cannot be listed as an extra fourth path.
    • D. Correct. The partition key of an existing container cannot be changed in place, so moving to HPK means creating a new HPK container and copying the data, for example with a container copy job.
    • E. Incorrect. The partition key definition is fixed when the container is created. Editing it in the portal settings cannot turn a single-key container into a hierarchical one.

    1.3: Design and implement data models and partitioning strategies

    5.A log ingestion container uses `/eventDate` (yyyy-MM-dd) as the partition key. All new events from all sources are written for the current day, and 429 errors appear at peak hours. What is the underlying anti-pattern?

    1. A.A date key exceeds the 101-byte limit on partition key values when large keys are off, so writes are throttled
    2. B.A date key hashes unevenly because the service handles strings poorly, so writes pile onto one physical partition
    3. C.A date key gives new events one shared value, so a single logical partition takes the full write rate for the day
    4. D.A date key routes writes through the change feed, which processes the current day's events one at a time
    Show answer & explanation

    Correct answer: C — A date key gives new events one shared value, so a single logical partition takes the full write rate for the day

    • A. Incorrect. The 101-byte limit applies to partition key values, but a yyyy-MM-dd value is only ten characters. Key size is not what triggers the 429 responses.
    • B. Incorrect. Cosmos DB hashes string values well and spreads distinct values across physical partitions. Throttling occurs because concurrent writes share one value, not because of the data type.
    • C. Correct. A date value is the same for every event written on a given day, so all new items land in one logical partition. That partition is limited to the throughput of a single physical partition, which creates a write hotspot and 429 errors at peak hours.
    • D. Incorrect. The change feed is a read-side mechanism over data that is already committed. Choosing a date key does not route writes through it, and it does not serialize or throttle ingestion.

    1.4: Implement change feed

    6.Two applications, one that sends emails and one that refreshes a search index, must each receive every change from the same `orders` container. The team wants to reuse a single lease container. What should they configure?

    1. A.Point each application at a separate lease container with its own `processorName`, so each keeps its own checkpoints and sees the full feed.
    2. B.Point both applications at one lease container with a distinct `processorName` for each, so each keeps its own checkpoints and sees the full feed.
    3. C.Point both applications at one lease container with one `processorName` and separate instance names, so each keeps its own checkpoints and sees the full feed.
    4. D.Switch both applications to the change feed pull model with a `FeedIterator`, so each keeps its own continuation tokens and sees the full feed.
    Show answer & explanation

    Correct answer: B — Point both applications at one lease container with a distinct `processorName` for each, so each keeps its own checkpoints and sees the full feed.

    • A. Separate processor names would give each application the full feed, but a lease container per application ignores the requirement to reuse a single lease container. The processor name alone is enough to keep their state apart.
    • B. Two deployment units can share one lease container when each uses a different processor name. Each then gets its own lease documents and checkpoints and receives every change, which suits the email and search-index consumers.
    • C. Identical processor names make both applications one deployment unit, and instance names only tell the compute instances inside it apart. The leases are divided between the applications, so each receives only part of the changes.
    • D. The pull model with a `FeedIterator` can give each application the full feed, but it tracks position with continuation tokens and uses no lease container. That abandons the plan to share one lease container.

    1.4: Implement change feed

    7.A company uses latest version mode and must be able to react to deleted orders without changing to another mode. Which approach does the documentation recommend?

    1. A.Filter the change feed on the `operationType` property, so entries with the value delete identify removed orders in the latest version feed.
    2. B.Poll the feed at an interval shorter than the container TTL, so expired or removed items are returned with a tombstone marker before purge.
    3. C.Read the `previous` property on each change record, so the last image of a removed order is available to the processor in this mode.
    4. D.Write a soft-delete flag onto the order with an update and set a TTL, so the feed delivers that update before the item is purged.
    Show answer & explanation

    Correct answer: D — Write a soft-delete flag onto the order with an update and set a TTL, so the feed delivers that update before the item is purged.

    • A. Latest version mode records only creates and updates and its change records carry no operation type metadata, so there are no delete entries to filter on. Operation types belong to the all versions and deletes mode.
    • B. Latest version mode never emits a tombstone for removed or expired items, however short the polling interval is. A faster poll only reads the same creates and updates sooner.
    • C. In latest version mode each change record holds only the current state of the item, with metadata such as `_lsn`, `_ts` and `_etag`. It has no previous image property, and a removed item produces no record at all.
    • D. The feed cannot report a delete in this mode, so the deletion is modelled as an update that sets a flag. The feed captures that update, and the TTL then purges the item, which lets the processor react without switching modes.

    1.4: Implement change feed

    8.A container has a container-level default TTL, and some items carry their own `ttl` values. After a copy job, which statements are accurate? (Select all that apply.)(Select 3)

    1. A.Per-item ttl values are carried to the destination and adjusted so each item keeps the time it had left before expiring.
    2. B.The container default TTL is copied to the destination when the target container sits in the same database as the source.
    3. C.The container's default TTL is not carried over by the job, so the destination container needs its own TTL setting configured.
    4. D.Once copied, items are evaluated under the destination container's TTL configuration, which decides whether item ttl applies.
    5. E.Items already past their expiry are replayed as deletes in the target, so the expiry shows up in its change feed.
    6. F.Item ttl values are reset to the destination default, so copied items start a new lifetime counted from the copy time.
    Show answer & explanation

    Correct answers: A, C, D — Per-item ttl values are carried to the destination and adjusted so each item keeps the time it had left before expiring.; The container's default TTL is not carried over by the job, so the destination container needs its own TTL setting configured.; Once copied, items are evaluated under the destination container's TTL configuration, which decides whether item ttl applies.

    • A. Accurate. The copy job carries item-level ttl values across and recalculates them, so each item keeps the time it had left before expiry instead of starting over.
    • B. Inaccurate. The container-level default TTL is a container property that the job does not copy, whether or not the target is in the same database as the source.
    • C. Accurate. The container-level default TTL is a property of the container itself and is not transferred, so the destination container must have its own TTL configured separately.
    • D. Accurate. After the copy, expiry is judged by the destination container's TTL configuration, which determines whether the item-level ttl values on copied items take effect.
    • E. Inaccurate. The copy job does not replay expiry as delete operations in the target, so nothing about expired items is written to the destination's change feed.
    • F. Inaccurate. Item-level ttl values are recalculated to preserve each item's remaining time. They are not overwritten with the destination default or restarted as a full lifetime from the copy time.

    1.5: Design and implement Azure Cosmos DB solutions by using AI-assisted tools

    9.A developer asks the Agent Kit to optimize a slow query. Which set of context best lets the assistant separate supported recommendations from hypotheses?

    1. A.The query text, partition key path, indexing policy, representative sample documents, and the RU charge with query metrics.
    2. B.The query text, container throughput setting, account region list, and a cost analysis export showing monthly spend by resource.
    3. C.The query text, partition key path, entity relationship diagram, and the SDK version with connection and retry settings.
    4. D.The query text, client-side latency percentiles from application logs, the app's deployment region, and CPU charts for its host.
    Show answer & explanation

    Correct answer: A — The query text, partition key path, indexing policy, representative sample documents, and the RU charge with query metrics.

    • A. Partition key, indexing policy and sample documents show how the query is served, and the RU charge with query metrics measures its cost. Each recommendation can then be tied to evidence instead of guessed.
    • B. Throughput, regions and monthly spend are account-level figures. They show neither the partition key and indexing policy nor the RU charge of this one query, so any tuning advice stays a hypothesis.
    • C. The partition key and data model help, but without the indexing policy and a measured RU charge with query metrics, the assistant cannot confirm where the cost comes from. SDK and retry settings do not close that gap.
    • D. Client-side latency and host CPU are measurements, but they say nothing about RU consumption, partition fan-out or index usage. The partition key and indexing policy are also missing, so recommendations remain unverified.

    1.5: Design and implement Azure Cosmos DB solutions by using AI-assisted tools

    10.A team wants the coding assistant to both apply the Agent Kit's guidance and inspect live container metrics in a dev account. What does this require? (Select all that apply.)(Select 2)

    1. A.The Cosmos DB skills installed in the assistant, giving it modeling and query guidance for the code
    2. B.The developer's Azure CLI sign-in, reused by the installed skills to read metrics in the dev account
    3. C.Database tools configured for the assistant, with credentials and permissions on the dev account
    4. D.The Microsoft Learn MCP server connected to the assistant, used to query metrics in the dev account
    5. E.A project instructions file listing the dev account's endpoint and containers, read at session start
    Show answer & explanation

    Correct answers: A, C — The Cosmos DB skills installed in the assistant, giving it modeling and query guidance for the code; Database tools configured for the assistant, with credentials and permissions on the dev account

    • A. The kit's skills are the guidance layer. With them installed, the assistant can apply Cosmos DB modeling and query rules to the team's code and data model.
    • B. Skills are guidance only and do not query accounts. The developer's Azure CLI sign-in does not give them a path to container metrics, so live inspection needs separately configured tools.
    • C. Reading live container metrics is a separate capability from guidance. It needs database tools set up for the assistant, with credentials and permissions on the dev account.
    • D. The Microsoft Learn MCP server serves documentation. It does not connect to a Cosmos DB account, so it cannot return metrics from the dev account.
    • E. An instructions file only gives the assistant text to read. Naming the endpoint and containers grants no credentials or permissions, so it cannot retrieve live metrics.

    1.1: Evaluate resource models and SDK solutions

    11.A team created a container with dedicated 4,000 RU/s. They now want it and nine other containers to share one database-level pool to reduce cost. What is the supported way to achieve this?

    1. A.Switch the container to shared throughput on the Scale & Settings blade in the portal, which folds its 4,000 RU/s into the database-level pool.
    2. B.Run `az cosmosdb sql container throughput migrate` on the container, which moves its 4,000 RU/s into the database-level throughput pool.
    3. C.Create a database with shared throughput, create the ten containers in it, and copy the data over, for example with a container copy job.
    4. D.Call `ReplaceThroughputAsync` on the database with the container's id, which attaches the container to the database pool in place.
    Show answer & explanation

    Correct answer: C — Create a database with shared throughput, create the ten containers in it, and copy the data over, for example with a container copy job.

    • A. The Scale & Settings blade only adjusts the container's own RU/s. Whether a container has dedicated or shared throughput is fixed when it is created, so no portal setting converts an existing container.
    • B. The throughput migrate command switches a resource between manual and autoscale provisioning. It does not move a container from dedicated throughput into a database-level pool, so the 4,000 RU/s stays dedicated.
    • C. A container's throughput model cannot be changed in place. The containers must be created in a database provisioned with shared throughput, and the existing data copied into them, for example with a container copy job.
    • D. ReplaceThroughputAsync on a database only changes the RU/s of that database's own pool and takes a throughput value, not a container id. It cannot attach an existing dedicated-throughput container to the pool.

    1.1: Evaluate resource models and SDK solutions

    12.A container partitioned on `/category` is throttling because 40% of items share one category. The team wants to partition on `/customerId` instead. What is the supported approach?

    1. A.Create a new container keyed on `/customerId`, copy the items over with a container copy job or the change feed, then repoint the application to it.
    2. B.Convert the existing container to hierarchical partition keys by adding `/customerId` as a second level, then let Cosmos DB redistribute the items.
    3. C.Open the container's Scale & Settings blade in the Azure portal, change the partition key to `/customerId`, then wait for the background rewrite to finish.
    4. D.Call `ReplaceContainerAsync` with a `ContainerProperties` that sets the partition key path to `/customerId`, then verify the items moved with a query.
    Show answer & explanation

    Correct answer: A — Create a new container keyed on `/customerId`, copy the items over with a container copy job or the change feed, then repoint the application to it.

    • A. The partition key path of an existing container cannot be modified. The data has to be copied into a new container created with the desired key, and the application then points to it.
    • B. Hierarchical partition keys can only be defined when a container is created. An existing container cannot gain another level, and Cosmos DB does not redistribute its items.
    • C. The portal offers no in-place partition key edit, and Cosmos DB does not rewrite physical partitions to a new key. Existing data has to be moved into a new container.
    • D. Replacing container properties can change settings such as the indexing policy and default TTL, but the partition key path is immutable and a replace call never moves items.

    1.2: Implement database operations

    13.A catalog service stores 1 KB product documents in a container partitioned by `/categoryId`. The service already knows a product's `id` and `categoryId` and must fetch that one product with the lowest possible RU charge and latency. Which call should it use?

    1. A.Call `ReadItemAsync<Product>` with the product id and a `PartitionKey` created from the item's category value.
    2. B.Call `GetItemQueryIterator<Product>` with `WHERE c.id = @id` and `QueryRequestOptions.PartitionKey` set to the category value.
    3. C.Call `GetItemLinqQueryable<Product>` with a `Where` on the id and category properties, then take the first result.
    4. D.Call `ReadItemAsync<Product>` with the product id and `PartitionKey.None`, leaving the partition lookup to the gateway.
    Show answer & explanation

    Correct answer: A — Call `ReadItemAsync<Product>` with the product id and a `PartitionKey` created from the item's category value.

    • A. A point read with the item id and its partition key value goes straight to the owning partition. It costs about 1 RU for a 1 KB item, which is less than any query, and has the lowest latency.
    • B. Scoping the query to one partition avoids a cross-partition fan-out, but it is still a query. It pays query execution overhead and costs more RUs than a point read.
    • C. LINQ is translated to a SQL query, so it pays query overhead and RU cost even when the filter includes the partition key property. A point read on a known id and partition key is cheaper.
    • D. `PartitionKey.None` addresses documents that have no partition key value, and the gateway does not infer a partition from the id. Ids are unique only within a logical partition, so the read does not find this product.

    1.2: Implement database operations

    14.Which two statements about the partial document update (patch) feature in Azure Cosmos DB for NoSQL are accurate?(Select 2)

    1. A.A transactional batch can include patch operations only when no create, replace or delete operations are in the same batch.
    2. B.Patch RU charge is based on the size of the patch payload, so a small patch on a large document costs far less than a replace.
    3. C.A patch request with a filter predicate such as `FROM c WHERE c.status = 'open'` updates the matching documents in its partition.
    4. D.Operations in one patch request are applied as a unit, so if one operation fails, none of the changes are saved to the document.
    5. E.A `PatchOperation.Add` on a path ending in `/-`, such as `/tags/-`, adds the supplied value as the last element of that array.
    Show answer & explanation

    Correct answers: D, E — Operations in one patch request are applied as a unit, so if one operation fails, none of the changes are saved to the document.; A `PatchOperation.Add` on a path ending in `/-`, such as `/tags/-`, adds the supplied value as the last element of that array.

    • A. Patch operations can sit in a transactional batch next to create, replace, upsert and delete operations for the same partition key. No restriction limits the batch to patch-only content.
    • B. The write RU charge still depends on the size of the whole document and its indexed properties, not on the size of the patch payload. A small patch on a large document is therefore not far cheaper than a replace.
    • C. A patch request always targets one item, identified by `id` and partition key. The filter predicate is a condition that item must meet for the patch to apply, so it does not turn the request into a set-based update.
    • D. The operations in a patch request are processed as a unit. If one fails, none of the changes are persisted and the document stays as it was.
    • E. Ending an array path in `/-` follows the JSON Patch convention for appending. `PatchOperation.Add` on `/tags/-` therefore places the value at the end of the array.

    1.2: Implement database operations

    15.An inventory flow must read two product documents in the same logical partition, move units between them only if the source holds enough stock, and commit both writes atomically. The decision depends on values read during the operation. Which implementation fits?

    1. A.Run a JavaScript stored procedure with the partition key supplied, so it reads both items and writes both inside one call.
    2. B.Enable bulk mode and send two parallel `PatchItemAsync` calls, with `IfMatchEtag` set on each to protect the stock values.
    3. C.Write the two items in separate requests, with a change feed processor that reverts the first write if the second fails.
    4. D.Attach a pre-trigger to the source replace that reads the target item and aborts when stock is short, then replace the target separately.
    Show answer & explanation

    Correct answer: A — Run a JavaScript stored procedure with the partition key supplied, so it reads both items and writes both inside one call.

    • A. A stored procedure runs server-side as one ACID transaction within a single logical partition. It can read both documents, check the source stock, and commit or roll back both writes together.
    • B. Each `PatchItemAsync` call is a separate request, and bulk mode only batches them for throughput. `IfMatchEtag` makes each write conditional on its own document, but it does not tie the two writes together. One patch can succeed while the other fails, leaving stock moved out of the source and never added to the target.
    • C. The change feed reacts after the first write is already committed, so the data is briefly inconsistent and the revert can itself fail. Separate requests with after-the-fact compensation give eventual consistency, not an atomic commit of both writes.
    • D. The pre-trigger runs only as part of the one replace it is attached to. It can validate stock for that operation, but the target document is then written in a separate request. The pair of writes is therefore not committed atomically, and the first one can succeed while the second fails.

    2: Secure, optimize, and deploy database solutions

    2.1: Implement database security controls

    16.A platform engineer has been given a custom data-plane role in Cosmos DB, but running `az cosmosdb sql role assignment create` to assign roles to application identities fails with an authorization error. What is missing?

    1. A.A data-plane `items/create` action added to the engineer's custom role, because role assignments are stored as items in a system container.
    2. B.A resource token with the All permission mode, which the CLI requires in order to write role assignment records into the account's metadata.
    3. C.An IP firewall rule for the engineer's workstation, because role assignment operations are accepted only from allow-listed client addresses.
    4. D.A control-plane permission such as `Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments/write` granted through an Azure RBAC role.
    Show answer & explanation

    Correct answer: D — A control-plane permission such as `Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments/write` granted through an Azure RBAC role.

    • A. Assignments are Azure Resource Manager resources, not documents in a container. Item data actions are unrelated.
    • B. The CLI calls the Resource Manager control plane with the engineer's Entra identity. Resource tokens are not used for this.
    • C. These operations go through the Azure Resource Manager endpoint, not the account's data endpoint, so the account firewall does not apply to them.
    • D. Role definitions and assignments are stored as account resources, so managing them requires control-plane permissions. Data actions alone cannot create them.

    2.2: Implement availability and recovery solutions

    17.A team wants to move the write region from West US to East US during planned maintenance with no data loss. Both regions are healthy. Which operation fits?

    1. A.Trigger a forced failover to East US, which promotes the region right away and keeps the account online
    2. B.Turn on multi-region writes, then remove West US from the account, which leaves East US accepting the writes
    3. C.Run a manual failover to East US, which waits for replication to catch up before promoting the region
    4. D.Enable service-managed failover with East US as top priority, which promotes it when the service detects a failure
    Show answer & explanation

    Correct answer: C — Run a manual failover to East US, which waits for replication to catch up before promoting the region

    • A. A forced failover promotes the target region immediately, without waiting for replication to finish. Any writes not yet replicated from West US can be lost, which breaks the no-data-loss requirement.
    • B. Enabling multi-region writes turns the account into a multi-writer account with conflict resolution, rather than moving a single write region. Removing West US then drops that replica instead of promoting East US in a controlled, lossless switch.
    • C. A manual failover between two healthy regions is a planned operation. Replication catches up before East US is promoted, so no writes are lost, which suits a maintenance window.
    • D. Service-managed failover only acts when the service detects an outage in the write region. West US is healthy, so nothing triggers it and the write region never moves.

    2.2: Implement availability and recovery solutions

    18.A team uses PPAF on an account with a single write region and non-strong consistency. A partition fails over during a region problem. Which risk remains?

    1. A.Partitions are restored from the latest periodic backup after the failover, discarding writes made since then
    2. B.Zone redundancy on the account is switched off until an administrator removes and re-adds the failed region
    3. C.Clients keep reading stale data from the failed partition until the preferred regions list is reordered by hand
    4. D.Writes acknowledged by the old primary but not yet replicated could be lost if the region's data is unrecoverable
    Show answer & explanation

    Correct answer: D — Writes acknowledged by the old primary but not yet replicated could be lost if the region's data is unrecoverable

    • A. A partition failover promotes a replica in another region. It does not restore partitions from periodic backups, and backups are used for explicit restore operations. Data loss here is limited to writes that had not replicated, not everything since the last backup.
    • B. PPAF moves a partition's write role to another region and leaves the account's zone redundancy settings alone. No administrator action on the region list is needed for the failover to complete.
    • C. With PPAF enabled, the SDK retries against another region and picks up the new write location without anyone editing the preferred regions list by hand. Reads are also not tied to the failed partition. The remaining risk concerns write durability, not routing.
    • D. With a single write region and a consistency level below strong, replication to other regions is asynchronous. Writes the old primary acknowledged but had not yet replicated can be lost if that region's data is permanently unrecoverable.

    2.2: Implement availability and recovery solutions

    19.Backups of a continuous account exist in the account's regions. The team asks if they would survive the loss of a whole Azure region. What is the accurate statement?

    1. A.Backups sit in a storage account you own, so copy them to a second region yourself to get a geo copy
    2. B.Backups follow the configured consistency level, so choose Bounded Staleness with a large lag to replicate them
    3. C.Backups stay in the regions where the account runs, so add another region to get a backup copy elsewhere
    4. D.Backups are written to the paired region by default, so restores keep working through a regional failure
    Show answer & explanation

    Correct answer: C — Backups stay in the regions where the account runs, so add another region to get a backup copy elsewhere

    • A. Continuous backups are service-managed and held in the regions where the account runs, not in a storage account the customer owns. There is no customer-side copy to move to another region.
    • B. Consistency levels control read guarantees across replicas. They do not change where backups are stored, so Bounded Staleness with a large lag adds no geo-redundancy to them.
    • C. Continuous backups are taken and kept per region of the account. Losing a whole region is only covered by adding another region to the account, which also gives a backup copy there.
    • D. Backups are not placed in a paired region by default. Each one lives in a region where the account exists, so a regional failure can still affect restore ability.

    2.3: Optimize and remediate database performance

    20.After adding new included paths to an indexing policy on a large container, a developer runs a query against the new path and gets fewer results than expected. The change was applied minutes ago. What is the most likely reason?

    1. A.A manual reindex must be started for the new paths to take effect, so queries on them return only documents written after the policy change.
    2. B.The SDK keeps the previous indexing policy cached on the client until restart, so queries on the new paths are evaluated against the old index.
    3. C.Index transformation for the new paths is still running in the background, so queries on them return partial results until it completes.
    4. D.A composite index is missing for the new paths, so queries on them fall back to a scan that stops after the first page of matching items.
    Show answer & explanation

    Correct answer: C — Index transformation for the new paths is still running in the background, so queries on them return partial results until it completes.

    • A. Incorrect. No manual reindex exists. After a policy change the service rebuilds the index online for existing items too, and progress is reported through the index transformation progress header.
    • B. Incorrect. Queries are evaluated by the service against the container's current indexing policy, and the SDK does not cache or apply an index policy locally, so restarting the client changes nothing.
    • C. Correct. A policy change is applied as an online background transformation. On a large container it takes time, and queries on newly included paths can return incomplete results until it reaches 100%.
    • D. Incorrect. Composite indexes serve ORDER BY and multi-property filters. Without one a query costs more request units but still returns complete results, and further pages come through continuation tokens.

    2.3: Optimize and remediate database performance

    21.A monitoring lead creates an Azure Monitor metric alert on a Cosmos DB account and needs the on-call team to receive an SMS and a ticket-system webhook. Which two settings make this possible?(Select 2)

    1. A.Enable the `ControlPlaneRequests` log category in the diagnostic setting and send it to Log Analytics, so the rule can notify the on-call team from those logs.
    2. B.Assign the on-call group the Cosmos DB Account Reader role on the account, so its members are added as the recipients of the rule's notifications.
    3. C.Set the rule's severity to Sev 0 and enable the auto-resolve option, so the on-call team is paged whenever the rule fires on the account.
    4. D.Specify the rule's condition with a metric signal, aggregation type, operator, threshold and evaluation frequency, so the rule can evaluate the account.
    5. E.Attach an action group to the rule with SMS and webhook actions configured, so notifications reach the on-call team and the ticketing system.
    Show answer & explanation

    Correct answers: D, E — Specify the rule's condition with a metric signal, aggregation type, operator, threshold and evaluation frequency, so the rule can evaluate the account.; Attach an action group to the rule with SMS and webhook actions configured, so notifications reach the on-call team and the ticketing system.

    • A. Incorrect. Control plane request logs feed log-based alerts and diagnostics. A metric alert evaluates platform metrics and sends nothing based on a diagnostic log category or a Log Analytics destination.
    • B. Incorrect. Azure RBAC roles only control who can read or manage the account. They do not make anyone an alert recipient, and SMS and webhook targets are defined in an action group.
    • C. Incorrect. Severity and the auto-resolve option describe how an alert is classified and when it closes. Neither defines SMS or webhook targets, so nobody is notified from these settings alone.
    • D. Correct. A metric alert rule needs a full condition (signal, aggregation, operator, threshold and evaluation frequency) before it can evaluate Cosmos DB metrics and fire.
    • E. Correct. An action group holds the SMS and webhook actions. Attaching it to the alert rule is how those notifications reach the on-call team and the ticketing system.

    2.3: Optimize and remediate database performance

    22.A product query `SELECT * FROM c WHERE CONTAINS(c.name, @term) AND c.price > 10` is expensive. Which three changes are likely to reduce its RU charge?(Select 3)

    1. A.Keep `/price/?` in the indexing policy, letting the engine narrow the candidate set from the index before reading documents.
    2. B.Use `STARTSWITH` in place of `CONTAINS` where a prefix match is enough, letting the engine serve the name filter from the range index.
    3. C.Append `OFFSET 0 LIMIT 1000000` to the query, giving the engine a bounded result size to plan the index scan against.
    4. D.Add the container's partition key to the filter, letting the query run against a single logical partition instead of fanning out.
    5. E.Exclude `/price/?` from the indexing policy, letting the engine skip index lookups for the price filter and lower the read charge.
    6. F.Wrap `c.name` in `LOWER` on both sides of the comparison, letting the engine match the term through its lowercase index entries.
    Show answer & explanation

    Correct answers: A, B, D — Keep `/price/?` in the indexing policy, letting the engine narrow the candidate set from the index before reading documents.; Use `STARTSWITH` in place of `CONTAINS` where a prefix match is enough, letting the engine serve the name filter from the range index.; Add the container's partition key to the filter, letting the query run against a single logical partition instead of fanning out.

    • A. Correct. With the price path indexed, the engine can use the range index to rule out documents failing the price condition, so fewer documents are loaded and the RU charge drops.
    • B. Correct. STARTSWITH can be answered from the range index, whereas CONTAINS forces much heavier evaluation of the name property. Where a prefix match meets the requirement, the swap lowers the RU charge.
    • C. Incorrect. OFFSET and LIMIT only cap how many results are returned. Adding a huge limit gives the planner nothing to optimize and does not reduce the documents examined, so the RU charge stays the same.
    • D. Correct. Filtering on the partition key routes the query to one logical partition instead of fanning out across all of them, which removes the per-partition overhead and lowers the RU charge.
    • E. Incorrect. Excluding the price path removes the index the engine would use for the range filter, so more documents must be loaded and checked. That raises the RU charge rather than lowering it.
    • F. Incorrect. LOWER is a system function applied to the property, so the comparison is evaluated per document rather than served from the index. Cosmos DB keeps no lowercase index entries, and the RU charge does not fall.

    2.4: Implement Fleet management and monitoring across multiple accounts and subscriptions

    23.A fleet analytics destination is an ADLS Gen2 storage account, and nothing is written. Which action grants the required access?

    1. A.Give the export job an account SAS token with write permission, entered in the fleet's destination settings in the portal
    2. B.Give the shared Cosmos DB Fleet Analytics service principal the Storage Blob Data Reader role in the account's IAM
    3. C.Give the fleet administrators' Microsoft Entra group the Storage Account Contributor role in the account's IAM settings
    4. D.Give the shared Cosmos DB Fleet Analytics service principal the Storage Blob Data Contributor role in the account's IAM
    Show answer & explanation

    Correct answer: D — Give the shared Cosmos DB Fleet Analytics service principal the Storage Blob Data Contributor role in the account's IAM

    • A. The export writes as the fleet analytics service principal, and its access comes from an Azure role assignment on the storage account. A SAS token entered in the destination settings is not the credential that writer uses, so nothing would be written.
    • B. The principal is correct, but Storage Blob Data Reader only allows reading blobs. The export has to create and write files, so with this role the write would still be denied.
    • C. Storage Account Contributor is a management-plane role with no blob data actions. It is also granted to the administrators rather than the service principal that performs the export, so the writer still has no data access.
    • D. Storage Blob Data Contributor is a data-plane role that permits writing blobs. Assigned to the fleet analytics service principal on the storage account, it lets the export job write its output.

    2.4: Implement Fleet management and monitoring across multiple accounts and subscriptions

    24.Which destinations can fleet analytics export hourly Delta Lake data to? Select all that apply.(Select 2)

    1. A.An Azure Event Hubs namespace that has Capture enabled and stores the hourly records as Avro blobs
    2. B.An Azure Data Lake Storage Gen2 account that was created with the hierarchical namespace feature enabled
    3. C.An Azure SQL Database that sits in the same subscription and is loaded with the fact and dimension tables
    4. D.A Log Analytics workspace table that is created through a diagnostic setting on the fleet resource
    5. E.A Microsoft Fabric workspace that uses OneLake as its default storage and is backed by Fabric capacity
    Show answer & explanation

    Correct answers: B, E — An Azure Data Lake Storage Gen2 account that was created with the hierarchical namespace feature enabled; A Microsoft Fabric workspace that uses OneLake as its default storage and is backed by Fabric capacity

    • A. Event Hubs Capture does write Avro blobs, but that is a streaming-ingestion feature. Event Hubs is not a supported destination for fleet analytics exports of Delta Lake data.
    • B. ADLS Gen2 is the other supported destination.
    • C. Azure SQL Database is not a supported fleet analytics destination. Being in the same subscription and receiving the tables does not make it an export target for the Delta Lake data.
    • D. Fleet analytics does not write to Log Analytics; resource logs are a separate feature.
    • E. Fabric OneLake is a supported destination.

    2.4: Implement Fleet management and monitoring across multiple accounts and subscriptions

    25.Which accounts are eligible to share one pooled fleetspace? Select all that apply.(Select 2)

    1. A.Two single-region write accounts, one replicated to East US, West US and Central US, the other to East US, West US 2 and Central US
    2. B.Two single-region write accounts, both deployed to Sweden Central with that region as the only location for each account
    3. C.Two single-region write accounts, one deployed to East US as its only region, the other deployed to both East US and West US
    4. D.A multi-region write account and a single-region write account, both deployed to West US as their only Azure region
    5. E.Two multi-region write accounts, each replicated to the same two Azure regions, West Europe and North Europe, with writes in both
    Show answer & explanation

    Correct answers: B, E — Two single-region write accounts, both deployed to Sweden Central with that region as the only location for each account; Two multi-region write accounts, each replicated to the same two Azure regions, West Europe and North Europe, with writes in both

    • A. The two accounts are replicated to different sets of regions. West US versus West US 2 means the sets differ, and accounts can pool throughput only when their region sets are identical. Overlap in two regions does not make up for it.
    • B. Both accounts have the same write configuration (single-region write) and the same region set (Sweden Central only), so they match on everything pooling requires and can share one pooled fleetspace.
    • C. One account lives in a single region and the other spans two. Pooling needs an identical set of regions, and sharing East US is not enough.
    • D. Both accounts sit in the same single region, but one is multi-region write and the other single-region write. Pooled accounts need a matching write configuration, so these two cannot share a pool.
    • E. Both accounts use multi-region write and are replicated to the same two regions. The write configuration and the set of regions both match, so the accounts can share one pooled fleetspace.

    2.1: Implement database security controls

    26.An Azure Functions app must read and write items in a container, and the security team forbids storing any secret in app settings or code. Which TWO actions satisfy this requirement?(Select 2)

    1. A.Store the account's primary key in Azure Key Vault, then reference that secret from an app setting the function uses for its CosmosClient connection string.
    2. B.Create a Cosmos DB user and permission, then have the function generate a resource token for each call and give that token to the SDK as its credential.
    3. C.Enable a system-assigned managed identity on the function app, then create a Cosmos DB data-plane role assignment for that identity's principal ID.
    4. D.Construct the CosmosClient with the account endpoint and DefaultAzureCredential, then drop the connection string that contains an AccountKey value.
    5. E.Enable a system-assigned managed identity on the function app, then give its principal the Azure RBAC Contributor role on the Cosmos DB account scope.
    Show answer & explanation

    Correct answers: C, D — Enable a system-assigned managed identity on the function app, then create a Cosmos DB data-plane role assignment for that identity's principal ID.; Construct the CosmosClient with the account endpoint and DefaultAzureCredential, then drop the connection string that contains an AccountKey value.

    • A. A Key Vault reference resolves to the account key in the app's settings at runtime, so the function still authenticates with a shared secret. Moving the key into a vault does not remove it from the design.
    • B. Generating resource tokens requires the function to authenticate to Cosmos DB with the account's master key or another privileged credential. The app would still have to hold a secret, so the restriction is not met.
    • C. The system-assigned identity gives the app an Entra ID principal with no stored credential. A Cosmos DB data-plane role assignment is what authorizes that principal to read and write items.
    • D. Using a token credential makes the SDK obtain Entra ID tokens for the managed identity at runtime. No key or connection secret is read from configuration or code.
    • E. Contributor is an Azure RBAC control-plane role for managing the account resource. It does not authorize item reads and writes, which need a Cosmos DB data-plane role, so those operations would be rejected.

    2.1: Implement database security controls

    27.A card number field holds 16 digits. Unprivileged readers should see the first four and the last four digits, with the eight middle digits masked. Which masking path definition accomplishes this?

    1. A.`{"path": "/CreditCard", "strategy": "MaskSubstring", "startPosition": 0, "length": 8}`
    2. B.`{"path": "/CreditCard", "strategy": "MaskSubstring", "startPosition": 5, "length": 8}`
    3. C.`{"path": "/CreditCard", "strategy": "MaskSubstring", "startPosition": 8, "length": 4}`
    4. D.`{"path": "/CreditCard", "strategy": "MaskSubstring", "startPosition": 4, "length": 8}`
    Show answer & explanation

    Correct answer: D — `{"path": "/CreditCard", "strategy": "MaskSubstring", "startPosition": 4, "length": 8}`

    • A. This masks the first eight characters, leaving only the last eight digits visible. The first four digits would be hidden.
    • B. Start positions are zero-based, so starting at 5 for 8 characters masks digits six through thirteen. That exposes the first five digits and only the last three, instead of four on each side.
    • C. This hides digits nine through twelve only, leaving the first eight and the last four visible. It masks too few digits.
    • D. MaskSubstring masks length characters starting at the start position. Starting at 4 for 8 characters hides digits five through twelve.

    3: Implement AI and analytics capabilities in database solutions

    3.2: Design and implement agent memory stores

    28.A multi-tenant SaaS stores hundreds of millions of facts. Each query searches only within one tenant, and queries must stay fast as the data grows. Which design best supports semantic memory at this scale?

    1. A.Partition on /id so storage spreads evenly, use a flat vector index, and run each VectorDistance query across all partitions.
    2. B.Partition on /tenantId, use a diskANN vector index, and run each VectorDistance query scoped to the tenant's partition key.
    3. C.Create one database account per tenant and keep a single small flat index in each, accepting separate keys and endpoints per tenant.
    4. D.Use one logical partition for all tenants with a quantizedFlat index and filter by tenantId in the WHERE clause on each query.
    Show answer & explanation

    Correct answer: B — Partition on /tenantId, use a diskANN vector index, and run each VectorDistance query scoped to the tenant's partition key.

    • A. An id-based key spreads tenants everywhere and forces fan-out queries, while a flat index does brute-force scans that degrade at this scale.
    • B. Partitioning by tenant and scoping queries to the partition keeps vector search to one tenant's data, and diskANN handles large vector volumes with low latency.
    • C. Per-tenant accounts explode operational overhead and cost; vector partitioning within one container is the supported way to isolate tenants.
    • D. A single logical partition hits the 20 GB limit quickly and cannot hold hundreds of millions of facts.

    3.1: Design and implement AI retrieval

    29.A team stores 1536-dimension embeddings produced as `float32` values in Azure Cosmos DB for NoSQL. Storage cost for the vector property is high and a small recall loss is acceptable. Which vector policy change reduces the vector storage footprint by about half?

    1. A.Set the vector index `type` to `flat` for the vector path, so vectors are stored alongside the other indexed properties
    2. B.Set `distanceFunction` to `dotproduct` for the vector path, so each embedding is stored in a normalised, shorter form
    3. C.Set `dataType` to `float16` for the vector path, so each vector element is stored in two bytes rather than four
    4. D.Set `dimensions` to 768 for the vector path, so only the first 768 elements of each incoming embedding are stored
    Show answer & explanation

    Correct answer: C — Set `dataType` to `float16` for the vector path, so each vector element is stored in two bytes rather than four

    • A. A flat index keeps vectors uncompressed, so it does not shrink anything, and it supports at most 505 dimensions, which rules it out for 1536-dimension embeddings.
    • B. The distance function only defines how similarity is scored at query time. Each element is still a 4-byte float32, so the stored size is unchanged.
    • C. Declaring the path as float16 stores each element in 2 bytes instead of 4, cutting the vector footprint by about half at the cost of a small loss in precision and recall.
    • D. Cosmos DB does not truncate vectors to fit the declared dimensions. Documents carrying 1536 elements against a 768 declaration are rejected, so storage does not shrink.

    3.1: Design and implement AI retrieval

    30.An application stores 1536-dimension embeddings in a container and wants exact, brute-force nearest neighbour results. The architect proposes a `flat` vector index. Why will this configuration not work as proposed?

    1. A.A `flat` vector index supports only the `euclidean` distance function, which cannot be applied to 1536-dimension `float32` vectors
    2. B.A `flat` vector index is built only after 1,000 vectors are stored, a threshold this container has not yet reached
    3. C.A `flat` vector index can be defined only on the partition key path, and a 1536-element array of numbers cannot serve as that key
    4. D.A `flat` vector index is capped at 505 dimensions, which rules out storing 1536-dimension vectors under that index type
    Show answer & explanation

    Correct answer: D — A `flat` vector index is capped at 505 dimensions, which rules out storing 1536-dimension vectors under that index type

    • A. Flat indexes work with cosine, dot product and euclidean distance, and float32 vectors are fine. The distance function is not the obstacle; the dimension ceiling is.
    • B. The 1,000-vector minimum relates to the quantization step of quantizedFlat and diskANN. A flat index scans the stored vectors directly, so it has no such population requirement.
    • C. Vector indexes are declared on the vector paths named in the container's vector policy. They are not tied to the partition key path, so the partition key's type is irrelevant.
    • D. Flat indexes are limited to 505 dimensions, so 1536-dimension embeddings cannot use them. quantizedFlat and diskANN allow up to 4096 dimensions.

    3.1: Design and implement AI retrieval

    31.In a hybrid query, the team wants the vector similarity ranking to count twice as much as the BM25 ranking. Which `RRF` call achieves this?

    1. A.`RRF(VectorDistance(c.vector, @v), FullTextScore(c.text, @t), [1, 2])`, with a trailing weights array, smaller value first
    2. B.`RRF(VectorDistance(c.vector, @v) * 2, FullTextScore(c.text, @t))`, with the factor applied to the vector component
    3. C.`RRF(VectorDistance(c.vector, @v), FullTextScore(c.text, @t), [2, 1])`, with a trailing weights array, larger value first
    4. D.`RRF([2, 1], VectorDistance(c.vector, @v), FullTextScore(c.text, @t))`, with a leading weights array, larger value first
    Show answer & explanation

    Correct answer: C — `RRF(VectorDistance(c.vector, @v), FullTextScore(c.text, @t), [2, 1])`, with a trailing weights array, larger value first

    • A. The array is in the right position, but weights map to the components in the order they are listed. Here the vector score gets 1 and the full-text score gets 2, which reverses the intended emphasis.
    • B. RRF fuses the rank positions each component produces, not the raw score values. Multiplying the VectorDistance expression by a constant leaves that ranking unchanged, so both rankings still count equally.
    • C. RRF takes an optional weights array as its final argument, matched to the component scores in order. [2, 1] gives the vector ranking weight 2 and the full-text ranking weight 1.
    • D. RRF expects the weights array after the component scores. Putting it first makes the call invalid instead of weighting the vector ranking more heavily.

    3.2: Design and implement agent memory stores

    32.You are creating the container for semantic memory. Each fact stores a 1536-dimension embedding in /embedding produced by an Azure OpenAI model. What must be configured when the container is created?

    1. A.Set /embedding as the partition key with hash partitioning across 1536 dimensions, and add a range index on that path in the indexing policy.
    2. B.Define a full-text policy on /embedding with language en-us, and add a full-text index on that path in the indexing policy for FullTextScore ranking.
    3. C.Add a composite index on /embedding and /id with ascending order in the indexing policy, and sort results with ORDER BY on the 1536 components.
    4. D.Define a vector embedding policy on /embedding with float32, 1536 dimensions and a distance function, and add a diskANN vector index in the indexing policy.
    Show answer & explanation

    Correct answer: D — Define a vector embedding policy on /embedding with float32, 1536 dimensions and a distance function, and add a diskANN vector index in the indexing policy.

    • A. A partition key must resolve to a scalar value, so a 1536-element float array cannot be one. Partitioning hashes values to spread data, not to group similar vectors, and a range index does not enable vector search.
    • B. Full-text policies and indexes apply to string paths and drive BM25 scoring through FullTextScore. A numeric float array is not text, so this cannot support similarity search over embeddings.
    • C. Composite indexes cover ordering across multiple scalar properties and cannot index the components of an array. Nearest-neighbor ranking uses VectorDistance over a vector index, not ORDER BY on the raw embedding.
    • D. Vector search needs a container vector embedding policy (path, dataType, dimensions, distanceFunction) and a matching vector index such as diskANN in the indexing policy, both set when the container is created.

    3.2: Design and implement agent memory stores

    33.Which TWO statements about the Agent Memory Toolkit are accurate?(Select 2)

    1. A.It is a Python SDK, currently in preview, that persists turns and derived memories such as summaries and facts in Azure Cosmos DB.
    2. B.It needs Azure Synapse Link enabled on the Cosmos DB account, so memories are mirrored to an analytical store before semantic search runs.
    3. C.It can keep memories in local in-memory storage while developing, then upload them to Azure Cosmos DB for persistence and shared access.
    4. D.It is a Python SDK that reached general availability with a production SLA, and it persists turns and summaries in Azure Cosmos DB.
    5. E.It stores derived memories in a separate managed memory service, and uses Azure Cosmos DB only to hold the raw conversation turns.
    Show answer & explanation

    Correct answers: A, C — It is a Python SDK, currently in preview, that persists turns and derived memories such as summaries and facts in Azure Cosmos DB.; It can keep memories in local in-memory storage while developing, then upload them to Azure Cosmos DB for persistence and shared access.

    • A. The toolkit is a Python SDK that is still in preview. It saves conversation turns and derived memories (summaries, facts, user summaries) as documents in Azure Cosmos DB.
    • B. Retrieval and vector search run directly against the transactional Cosmos DB container. No Synapse Link or analytical store is needed before semantic search works.
    • C. Local in-memory storage is meant for development and testing. Memories can later be uploaded to Azure Cosmos DB when persistence, sharing or semantic search is needed.
    • D. Although it is a Python SDK that stores data in Cosmos DB, it is still in preview. Previews come without an SLA and are not recommended for production workloads.
    • E. Cosmos DB holds both the raw turns and the derived memories (summaries, facts, user summaries). There is no separate memory service for the derived data.

    3.3: Design and implement operational analytics on Azure Cosmos DB

    34.A Fabric notebook must read the `products` container of an Azure Cosmos DB account into a Spark DataFrame by using the Spark 3 OLTP connector. Which configuration is correct?

    1. A.`spark.read.format("delta")` with the OneLake path of the mirrored database's `products` table, passed to `load`.
    2. B.`spark.read.format("mongodb")` with the `connection.uri`, `database` and `collection` options for the Cosmos DB account.
    3. C.`spark.read.format("cosmos.oltp")` with the `spark.cosmos.accountEndpoint`, `accountKey`, `database` and `container` options.
    4. D.`spark.read.format("jdbc")` with the account endpoint as the `url` option and the `products` container as `dbtable`.
    Show answer & explanation

    Correct answer: C — `spark.read.format("cosmos.oltp")` with the `spark.cosmos.accountEndpoint`, `accountKey`, `database` and `container` options.

    • A. Incorrect. Reading a mirrored copy as Delta from OneLake is a valid pattern, but it never calls the Cosmos DB account, so it does not use the Spark 3 OLTP connector.
    • B. Incorrect. The mongodb format belongs to the MongoDB Spark connector for the API for MongoDB. The OLTP connector for a NoSQL container uses the cosmos.oltp format.
    • C. Correct. These options identify the account, credentials, database and container for the OLTP connector.
    • D. Incorrect. Cosmos DB for NoSQL exposes no JDBC endpoint, so a url and dbtable pair cannot reach the container. The OLTP connector has its own data source format.

    3.3: Design and implement operational analytics on Azure Cosmos DB

    35.A mirrored database was just created for a 400 GB container that is actively updated. Which two statements describe what the team should expect? (Select two.)(Select 2)

    1. A.Committed changes reach the mirrored database within about one second, even while the container is under load.
    2. B.Type changes to items that predate mirroring might not appear until a backup that includes them is taken.
    3. C.The first load consumes the container's provisioned RUs, so it competes with the live workload until it finishes.
    4. D.Deletes in the container are not carried over to the mirror, leaving stale rows that analysts filter by `_ts`.
    5. E.The first load reads existing data once from continuous backup, then follows inserts, updates and deletes live.
    Show answer & explanation

    Correct answers: B, E — Type changes to items that predate mirroring might not appear until a backup that includes them is taken.; The first load reads existing data once from continuous backup, then follows inserts, updates and deletes live.

    • A. Incorrect. Mirroring is near real time, but there is no one-second commitment. Propagation can take a few minutes, and longer while a large, busy container is still being snapshotted.
    • B. Correct. This is a documented caveat of the initial backfill from backup.
    • C. Incorrect. The initial snapshot is read from the container's continuous backup, not through the live container. It does not consume the container's provisioned RUs, so the transactional workload does not compete with the load.
    • D. Incorrect. Mirroring replicates inserts, updates and deletes. Deleted items are removed from the mirrored database, so analysts do not need to filter stale rows by `_ts`.
    • E. Correct. The initial backfill is taken from continuous backup, after which changes are read in near real time.

    Want the full experience?

    These are just samples. Practice the full Microsoft Azure Cosmos DB AI Developer Associate (DP-420) question bank in quiz mode — free, no signup, with domain practice and exam simulation.