Hi Yadav •,
Welcome to Microsoft Q&A forum.
As I understand, you are getting OutOfMemoryException in Azure Cosmos DB.
Could you please check if you are not exceeding the resource limits:
You could try scaling up the DB for better performance.
Is the account with Provisioned, Serverless or Autoscale mode?
Awaiting your reply.
Thanks