This is going to be a quick post, but I just wanted to share how you can do a one time bulk import to a Azure Cosmos DB if you have a json file that contains all your documents.

You don’t need to install any software and this option is available in the Azure Portal as well as the local Azure Cosmos emulator portal.

  • Log into the Azure Portal https://portal.azure.com or use your local Azure Portal https://localhost:8081/_explorer/index.html.
  • Navigate to “Data Explorer”.
  • Then navigate to the database and the collection.
  • Select “Items”.
  • You should see an “Upload Item” button which you can click on. azure_cosmos_upload_button
  • A new panel will appear on the right where you can select a file to upload.
  • Done. That’s it!

azure_cosmos_items_uploaded

Summary

This is a quick post and a quick tip on how to bulk insert json documents using the upload item feature within the Azure Portal. Handy if you are testing and playing around with data.