Import and export Cosmos DB documents

Import JSON, JSONL or CSV into a container with an RU ceiling, and export a container or the loaded documents.

Import is in the Container menu, under “Import file”. Choose a JSON array, a JSONL file or a CSV file. Tablyne shows a preview with the number of documents, the average size and an RU estimate of about 5.5 RU per KB.

For CSV, you choose the column separator, whether the first row is a header, and whether an empty field becomes null. You also choose a type for each column: text, number, true or false, JSON, or skip.

Two choices control what happens to existing documents. “Skip existing ones” keeps what is in the container and counts the skipped ids. “Replace existing ones” overwrites by id and partition key, and Tablyne warns that this cannot be undone. A document without an id gets the value of a field you choose, or a new UUID.

The job has an RU ceiling. It stops when the total reaches the ceiling, and it warns you when the ceiling is below the estimate. Writes run in parallel, and you choose how many. If invalid documents are found, you can skip them and read them in the report, or let the whole file be checked before anything is written. The job shows progress in the job center, and you can stop it. Whatever was written stays. The result lists written, existing, failed and uncertain documents. Uncertain ones failed in transit, so check the container. On a production connection you type the connection name before the import starts.

Export covers the whole container or only the documents loaded in the grid. The whole container is read page by page from every partition. It spends RU, and the result says how many. Formats are JSON, JSONL and CSV. For CSV you choose the top-level properties, and objects and arrays are written as JSON. Formula protection is on by default for CSV and can be turned off in the export dialog.

Copying a container to another connection is not available for Cosmos DB.