I'm giving CosmosDB a chance and so I decided to build an app that uses it, but I'm running into this issue when using the emulator: Port is already in use.
I'm not sure where to reconfigure the port the emulator is pointing.
I had a similar problem, where i got an error "port 10253 already in use" which is a port for Direct connectivity. Direct connectivity port defaults for CosmosDB are 10251,10252,10253,10254.
Used the following Command-line Syntax to change the default port and it worked,
CosmosDB.Emulator.exe /DirectPorts=10261,10262,10263,10264
OR (in my case)
"C:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" /DirectPorts=10261,10262,10263,10264
Note: You can use port of your choice, but make sure that they are not already in use
If you prefer just to change the Windows Shortcut, right click > properties and add /port=8082
(or whatever port number you want) at the end of the Target
field after the quotes.
Note that in the Emulator Data Explorer, the URI field still showed the default port of 8081.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With