What is the Cosmos SQL rest API size limit for sending data in request body and how to process a large size API payload for Cosmos?

Amit Kumar 61 Reputation points
2022-09-26T19:32:51.467+00:00

We are using Cosmos SQL REST APIs to insert/update data in Cosmos db over RBAC. I saw MS documentations that max allowed limit is 2 MB.
![244865-image.png]1

How to store a data more than 2MB in cosmos DB using SQL APIs?
FYI, our API call is having all details in msg body and there is no attachment.

Thanks

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,454 questions
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 27,717 Reputation points Microsoft Employee
    2022-09-27T01:41:31.777+00:00

    Hi, @Amit Kumar Thanks for posting your question in the Microsoft Q&A forum.
    For SQL API Cosmos DB. 2 MB limit cannot be increased. Only Mongo DB can access the 16 MB Doc support, currently in Preview
    I can think of two options

    1. recommended to split the document into multiple sub-documents and create a new field to link them together. When retrieving, you would use a query to retrieve all documents that are linked together.

    Alternatively, you can use 'attachment' options as well for documents larger than 2 MB. however, this is something you don't want to go with as you mentioned there are no attachments.

    However, I am checking with the internal product team to provide you with more details.
    Regards
    Geetha

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful