I am trying to run the Cosmos DB Emulator on my Mac with an M2 chip. I followed the official Microsoft documentation that suggests using Parallels to run Windows and then install the Cosmos DB Emulator on the virtual machine.
Following the guide, I executed the following command in the Windows environment:
Microsoft.Azure.Cosmos.Emulator.exe /AllowNetworkAccess /Key=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
The emulator starts, and I can access it using https://localhost:8081/_explorer/index.html within the virtual machine. However, I am unable to access it from my Mac using the local IP address obtained via ipconfig. I keep getting an ERR_CONNECTION_REFUSED error.
Upon investigating further with netstat -a | findstr 8081, I noticed that the emulator is listening on 127.0.0.1:8081. I suspect this might be the reason I cannot connect using the local IP.
Here are some additional details:
- Parallels network settings: Running in "shared" mode.
- I attempted port forwarding using Parallels, but it didn't resolve the issue.
- I tried the "nofirewall" flag, deleted the contents of
%LOCALAPPDATA%\CosmosDBEmulator, disabled the firewall, and added allow rules without success.
Steps I've taken so far:
- Executed the emulator command in the Windows environment.
- Checked
netstatfor listening addresses. - Tried port forwarding via Parallels.
- Tried the "nofirewall" flag, deleted emulator contents, disabled firewall, and added allow rules.