Skip to content

Debugging Connection Errors

Stephen Weatherford (MSFT) edited this page Sep 3, 2019 · 3 revisions

Connecting to Mongo DB via Azure Cosmos DB Emulator (Windows)

Try the following:

  1. Make sure you have the Azure Cosmos DB Emulator installed (https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator)
  2. Make sure the emulator has been started, with the MongoDB endpoint enabled (it is no longer enabled by default as of version 2.4.3, see https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator). For example (change path appropriately):
"C:\Program Files\Azure Cosmos DB Emulator\Microsoft.Azure.Cosmos.Emulator.exe" /EnableMongoDbEndpoint
  1. Make sure the cosmosDB.emulator.mongoPort setting in vscode matches the port used by the emulator. By default this is 10255.

For more information, see https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator.

Connecting to local Mongo DB server

Make sure Mongo DB has been installed as a service or else has been started manually, for example (Windows):

c:\Program Files\MongoDB\Server\4.2\bin\mongod.exe
Clone this wiki locally