Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CosmosDB emulator can't start since port is already in use

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.

enter image description here

like image 252
Dustin Avatar asked Jun 30 '17 16:06

Dustin


2 Answers

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

like image 160
MechanicalCoder Avatar answered Oct 06 '22 08:10

MechanicalCoder


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.

Shortcut properties

like image 40
stu0292 Avatar answered Oct 06 '22 10:10

stu0292