I have an Azure Synapse pipeline that moves data from a .csv into a .parquet file which is then copied into two location, Azure SQL table and Azure CosmosDB. When moving into the Azure SQL table, I can delete existing records and the insert the new dataset. The CosmosDB portion uses upsert to update existing ones and insert new records. However, I am at a loss as how to check if any records in the CosmosDB are not in the new .parquet file and then delete them if they do not exist.
Is this better achieved on the CosmosDB side with a stored procedure or is there a method of using dynamic content on the write behavior of the copy data activity in Azure Synapse?


or upvote
button whenever the information provided helps you.