0
0
Azurecloud~20 mins

Functions with Cosmos DB integration in Azure - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Azure Functions Cosmos DB Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
How does an Azure Function trigger with Cosmos DB change feed behave?

An Azure Function is set to trigger on changes in a Cosmos DB container using the change feed. What happens when multiple changes occur rapidly in the container?

AThe function batches multiple changes and processes them together, while preserving order within the batch.
BThe function processes each change individually and sequentially, ensuring order is preserved.
CThe function triggers only once per minute regardless of changes, processing all changes at once.
DThe function triggers only for the first change and ignores subsequent changes until manually reset.
Attempts:
2 left
💡 Hint

Think about how change feed triggers optimize processing for multiple changes.

Configuration
intermediate
2:00remaining
Which configuration setting controls the lease container for Cosmos DB trigger in Azure Functions?

You want to configure an Azure Function with a Cosmos DB trigger. Which app setting specifies the container used to store leases for tracking processed changes?

AAzureWebJobsCosmosDBLeaseContainerName
BCosmosDBLeaseContainer
CCosmosDBTriggerLeaseContainerName
DAzureWebJobsCosmosDBLeasesContainerName
Attempts:
2 left
💡 Hint

Look for the exact app setting name used by Azure Functions runtime for Cosmos DB leases.

Architecture
advanced
3:00remaining
Designing a scalable Azure Function with Cosmos DB input binding

You need to design an Azure Function that reads documents from Cosmos DB using an input binding. The function must scale efficiently when many requests come in simultaneously. Which architecture choice best supports this?

AUse a single function instance with a large RU/s provisioned on Cosmos DB to handle all requests sequentially.
BUse a timer-triggered function that reads all documents periodically and caches results for all requests.
CUse a function with input binding that queries Cosmos DB without specifying partition key to simplify code.
DUse multiple function instances with input bindings that query Cosmos DB by partition key to distribute load evenly.
Attempts:
2 left
💡 Hint

Consider how Cosmos DB partitioning affects scalability and function instance distribution.

security
advanced
3:00remaining
Securing Azure Functions with Cosmos DB output binding

You have an Azure Function that writes data to Cosmos DB using an output binding. What is the best practice to secure the connection string used by the function?

AStore the Cosmos DB connection string directly in the function code as a constant string.
BStore the connection string in Azure Key Vault and reference it via managed identity in the function app settings.
CStore the connection string in a public GitHub repository for easy access by developers.
DHardcode the connection string in the function app settings without encryption.
Attempts:
2 left
💡 Hint

Think about secure storage and access of secrets in Azure.

🧠 Conceptual
expert
3:00remaining
Understanding consistency levels impact on Azure Function with Cosmos DB trigger

An Azure Function is triggered by Cosmos DB change feed. The Cosmos DB account uses Session consistency. How does this consistency level affect the function's visibility of changes?

AThe function sees changes only after a full global replication completes, causing high latency.
BThe function sees all committed changes immediately and in order across all regions.
CThe function sees changes in order per session, but changes from other sessions may be delayed or out of order.
DThe function cannot use change feed with Session consistency and will fail to trigger.
Attempts:
2 left
💡 Hint

Recall what Session consistency guarantees about read order and visibility.