Azure Function with Cosmos DB Trigger Not Executing on Document Creation
I'm experimenting with After trying multiple solutions online, I still can't figure this out. I've been banging my head against this for hours. I'm currently working with an scenario where my Azure Function, which is supposed to trigger on new document insertions in a Cosmos DB collection, is not executing as expected. I have set up the Azure Function with a Cosmos DB trigger using the following configuration in my `function.json`: ```json { "bindings": [ { "type": "cosmosDBTrigger", "name": "inputDocument", "databaseName": "MyDatabase", "collectionName": "MyCollection", "connectionStringSetting": "CosmosDBConnection", "leaseCollectionName": "leases", "createLeaseCollectionIfNotExists": true } ] } ``` The connection string is set correctly in the Azure Function Configuration settings: ```json { "CosmosDBConnection": "AccountEndpoint=https://mycosmosdb.documents.azure.com:443/;AccountKey=myAccountKey;" } ``` Despite this setup, the function does not trigger when I add new documents to the `MyCollection`. I have checked the logging, but there are no errors being thrown; it simply seems inactive. I also ensured that the 'leases' collection exists and is being managed properly by checking its document count in the Azure portal. Additionally, I set the function's timeout to 10 minutes, and I confirmed that my Azure Function App has the correct permissions to access the Cosmos DB account. I've tried redeploying the function and even creating a new Cosmos DB account to rule out any account-specific issues, but the question continues. Is there something specific I might be overlooking, such as incorrect lease management, or is there a known scenario with the version of the Cosmos DB SDK being used? Iām currently using Azure Functions v3 with the latest Azure Cosmos DB SDK (v3.2.0). Any insights would be greatly appreciated! This is part of a larger CLI tool I'm building. What am I doing wrong? What am I doing wrong? Cheers for any assistance!