Cosmo DB docker linux does not work on custom port

Andrey Lopatin 0 Reputation points

Hello, I am facing the same problem as it was described here

Basically, I would like to run cosmos DB container using a custom port (not 8081). If I have my application running as a docker - everything works as expected once I install the certificate following the official guide.

However, if I try to connect to the same cosmos DB container from a VS while developing my project - I cannot, Cosmos SDK just hangs forever

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,470 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Daryl Van Sittert 0 Reputation points

    After a lot of digging trying to do this myself, I found myself in the /usr/local/bin/cosmos/ file on the cosmos emulator. In that file, it executes Microsoft.Azure.Cosmos.Emulator.exe with a variable at the end for any other parameter that you want.

    So by adding an environment variable passing port, you can run this on any port that you want. Keep the enable preview flag because this is the default value for this parameter. AZURE_COSMOS_EMULATOR_ARGS='/port=18081 /enablepreview'

    So the full docker run might be something like: docker run --publish 18081:18081 --publish 10250-10255:10250-10255 -e AZURE_COSMOS_EMULATOR_ARGS='/port=18081 /enablepreview' -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=

    0 comments No comments