I have a Azure Function with a CosmosDBTrigger working on a consumption play monitored with Application Insights. The collection being monitored has 500,000 inserts in the change feed. The consumption plan scales up the number of instances to 15 within a few minutes but only the first instance is able to process any changes.
I assume this is because of the lease is kept by the first instance. I am essentially paying for 14 instances to do nothing.
I noticed you are supposed to be able to set a property on CosmosDBTrigger called LeaseOptions but I currently get an error whenever I try: "Error CS0655 'LeaseOptions' is not a valid named attribute argument because it is not a valid attribute parameter type"
Is there a way to scale a CosmosDBTrigger Azure Function so it can be processed by 10, 20 or even 200 instances at a time?