Deleting items in multiple partitions

Litty Kuriakose 106 Reputation points
2022-04-21T14:19:11.723+00:00

I am loading data from csv files (file size ~40 MB) to Azure Cosmos DB using Azure Data Factory.If data mismatches happened during dataload, I want to delete the data entered using the file and reload once again.The data will be loaded across multiple partitions.I tried deleting data using Azure Functions,but will get timed out 230sec.

Please help me with the preferred way to delete large data from multiple partitions. Kindly share any links that explains the method.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,342 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,207 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stephan van Rooij 61 Reputation points MVP
    2022-05-03T18:43:14.01+00:00

    It depends on how many partitions we are talking about.

    You can create a stored procedure that takes a partionKey and then queries all items in that partition and deletes them. Then you don't have get all the items in the Azure Functions first.

    https://learn.microsoft.com/en-us/azure/cosmos-db/sql/how-to-write-stored-procedures-triggers-udfs?tabs=javascript

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.