If you ever tried getting multiple documents from CosmosDB collection as on “file”, than you should do the following steps. There can be different requirements for this, but this is not scope of this blog.
Option I – directly in Azure Portal
(Option II – using Datamigration tool)
Here is, what you can do:
-
- First open up “Data Explorer” in CosmosDB Resource (Azure Portal) and select DB->Collection of your interest.
- Click “New SQL Query” -> this opens a new query pane with a select statement and also “Setting” to open up the settings SlideIn.
new query pane - In that SlideIn you have several options.
– one is to set a custom value on how many results can be displayed in one page
– another option is to remove the limitation of default 100 to unlimitedunlimited page results
custom page limit! Don’t forget to save !
- Next, go to query pane and leave the select statement, if you have no other conditions on the outcome. Click “Execute Query”. With this you can now grab the output in the results pane by CTRL+A and CTRL+C
execute query - Open your favorit text editor (I like VScode very much), paste in the clipboard and save as a file.
Here you go! 🙂 Hope this helps. If you have other suggestions, you’re welcome to add comments.