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?
Think about how change feed triggers optimize processing for multiple changes.
The Azure Function triggered by Cosmos DB change feed batches multiple changes together for efficient processing. While the batch preserves order of changes within it, the function does not process each change individually. This improves performance and scalability.
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?
Look for the exact app setting name used by Azure Functions runtime for Cosmos DB leases.
The correct app setting is AzureWebJobsCosmosDBLeaseContainerName. This setting tells the function which Cosmos DB container to use for storing leases that track the change feed progress.
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?
Consider how Cosmos DB partitioning affects scalability and function instance distribution.
Using multiple function instances with input bindings that specify the partition key allows Cosmos DB to distribute the load evenly. This supports efficient scaling and avoids hot partitions or throttling.
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?
Think about secure storage and access of secrets in Azure.
Storing secrets like connection strings in Azure Key Vault and accessing them via managed identity is a best practice. It avoids exposing secrets in code or unencrypted settings and supports secure, centralized secret management.
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?
Recall what Session consistency guarantees about read order and visibility.
Session consistency guarantees that reads within a session see writes in order, but across different sessions, there may be delays or out-of-order visibility. The change feed reflects committed changes but may not be globally ordered immediately.