As to my knowledge, CosmosDBTrigger doesn't allow to specify a partition key, so here are the options that I can think of-
- TimeTrigger and DocumentDB binding
DocumentDB input binding has a property that allows you to specify a partition key and sql query to retrieve the documents. The approach assumes that you'd be firing up your functions at some fixed intervals and reading the latest data out from the collection based on the last time that function has been triggered at.
Here is the list of all different parameters you could set up for the binding - Input configuration.
- Gateway and CosmosDBTrigger
The approach implies using CosmosDBTrigger with a dedicated Azure Function(Gateway) that will be called upon the changes in a given collection. The solely goal of that function would be to 'redirect' the incoming input based on the partition key toward more specific functions, like via http triggers or something.
For the sake of scalability, you could decouple Gateway and Specific Functions with storage queues.
- Separate service and Change Feed
Pretty much like a previous approach, but instead of implementing gateway as an Azure Function, you could have a service implemented in .NET running somewhere either in the cloud or on-prem. The SQL SDK for Azure Cosmos DB gives you all the power to read and manage a change feed, so that service will listen for whatever comes in the feed, and then distribute it across appropriate Azure Functions.
If you have multiple readers, you can use ChangeFeedOptions to distribute read load to different threads or different clients.