Returning documents as one file back from Azure CosmosDB[Reading Time: 2 minutes]
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
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.
- 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 unlimited
! 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
- 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.