3
votes

I try to import a bunch of JSON files into cosmos db emulator, so localhost. Ik try to do this using the DocumentDB Data Migration Tool. Before anyone says that the tool is not working for cosmos db. According to Microsoft it should work: https://docs.microsoft.com/en-us/azure/cosmos-db/import-data

But my problem is I can't connect to my local emulator. I tried Googling, but I can't find a right connection string for the tool to work. Any one any idea what the connection string for local emulator is? Or the username and password?

3
See if this helps: docs.microsoft.com/en-us/azure/cosmos-db/local-emulator (search the page for Key)Peter B
Thank you very much, I've bin there more than 100 times and didn't see that-_-. I need a rubber duck.apero
You can self-answer your question :)juunas

3 Answers

6
votes

Thanks to @Peter B!

Account name: localhost:<port>
Account key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==

Found at: https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator

2
votes

The username of Cosmosdb emulator account is localhost.And its password is the Primary Key mentioned in the Quickstart blade in the emulator.

1
votes

The connection string for your app can be

AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==

If you navigate to https://localhost:8081/_explorer/index.html, you can find all the details.

enter image description here

Make sure emulator is running to navigate to the url and use the url in chrome, firefox gives some wierd ssl error.