You are designing a serverless solution in Azure. You have an Azure Cosmos DB container named Orders. You deploy two separate Azure Functions, ProcessInvoice and UpdateInventory, within the same Function App. Both functions are triggered by changes in the Orders container using the Azure Cosmos DB trigger (CosmosDBTrigger). You configure both triggers to share a single lease container named leases to minimize resource consumption.
During testing, you observe that the two functions compete for partition leases, resulting in each update being processed by only one of the functions, rather than both. You need to ensure that both functions independently process every change feed event from the Orders container.
Which configuration action should you perform?
- ARe-create the leases container using a custom partition key such as /functionName to isolate the leases for each function.
- BConfigure ProcessInvoice to use a system-assigned managed identity and UpdateInventory to use a user-assigned managed identity for database connection.
- Configure a unique LeaseContainerPrefix (such as invoices_ and inventory_) for each function's trigger attribute.Cevap
- DScale out the Function App by migrating the hosting plan from the Consumption plan to a Dedicated App Service plan.