Better option to alter Azure cosmos db documents in PROD

152 views Asked by At

Need to alter around 10,000 Azure cosmos db documents by adding new property as one time activity on PROD, for this kind of scenario Bulk support in the .NET SDK v3 (OR) Cosmos DB Bulk Executor (OR) better off with a loop which replace documents one-by-one, which one to be considered?

1

There are 1 answers

9
tlzg On

I would probably go with Azure Functions that have CosmosDB trigger (with flag StartFromBeginning=true). That will send change feed for all of your documents into your Azure Function.

Now, i'd have a filter that checks if the document have that property or not. If it doesn't, i'd update it and if it does i'd do nothing. this second case is needed because change feed will trigger your Azure Function not only for first time but also after you update it.