Manish Singh
Manish Singh

Reputation: 23

Is it possible to subscribe change feed of multiple containers in single azure function

I am trying to subscribe changefeed of multiple azure cosmos db containers in single azure function. In documentation a CosmosDBTrigger only accepts single databaseName and collectionName

Is there any option so that we can provide multiple collectionName and databaseName in runtime to monitor for change in azure function.

Upvotes: 2

Views: 931

Answers (1)

Jay Gong
Jay Gong

Reputation: 23767

Document is right, single Azure function supports multiple cosmos db containers can't be implemented so far.You need to configure specific container information with every azure function cosmos trigger.

I presume that you need to do some business if some columns which is respective stored in the multiple cosmos db are all updated. If so, i provide my rough idea here:

Create multiple azure function triggers to respective connect with multiple cosmos db containers to monitor them. If any updates occur, call one common http endpoint to store the key information into Azure table or SQL database or something like that. Then judge if all the specific column updated, do your business.

Upvotes: 1

Related Questions