Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting a database or container from Azure Cosmos DB to my local storage

Azure Cosmos DB has an option of import to the database from local storage however, it has no such option of export.

I want to know all possible methods of directly exporting the database or a container to my local storage (json files) ie. without involvement of any other storage such as blob storage.

Thanks in advance!

like image 600
ashtrix-001 Avatar asked Oct 14 '25 18:10

ashtrix-001


2 Answers

2 options for your references:

1.Azure Cosmos DB Migration Tool, you could export cosmos db data into local json file,please refer to this link.

2.Azure Data Factory,you could use copy activity to transfer data from cosmos db source into local file system sinklink.

like image 133
Jay Gong Avatar answered Oct 17 '25 17:10

Jay Gong


A quick and simple way to export data from small containers is via a SQL query.

Write a new SQL query against your container:

enter image description here

And use the default query to select all of your data

SELECT * FROM c

This will give you all of your data in a json format, and you can copy paste it to a local file.

Note that this is only a good option for relatively small data amounts. For larger amounts of data you should stick with the options suggested by @JayGong in the accepted answer.

like image 41
dybzon Avatar answered Oct 17 '25 15:10

dybzon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!