My Isolated Azure functions cosmosDB trigger is invoked saying there are new changes on the container. But no new changes are received and the execution fails. This is creating false alerts as the request fails. Below are the two messages in the logs. How to fix this ?
Executing 'Functions.TestCosmosDBTrigger' (Reason='New changes on container TestContainer at 2023-02-16T00:09:39.3365522Z', Id=xxxxx-xxxx-xxx)
Executed 'Functions.TestCosmosDBTrigger' (Failed, Id=xxxxx-xxxx-xxx, Duration=86ms)
Edit:
[Function("TestCosmosDBTrigger")]
public async Task RunAsync([CosmosDBTrigger(
databaseName: "testdata",
containerName: "TestContainer",
Connection = "connect",
LeaseContainerName = "leases")] IReadOnlyList<MyDocument> input)
{
//first line
logger.LogInformation("Received count {}", input.Count);
}
Update :
After enabling logs. The only relevant logs available are as below:
"Category":"Host.Triggers.CosmosDB","LogLevel":"Error","prop__{OriginalFormat}":"Lease {LeaseToken} experienced an error during processing