https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator
Below is the cd command to navigate to default installation directory of the emulator:
C:\> cd "C:\Program Files\Azure Cosmos DB Emulator"
The /GenKeyFile=<key_filename_with_path> is run as a stand-alone option which generate new token/key onto specified keyfile. The file can be used with /KeyFile=<key_filename> option later to start the service. Or the content of file can used with /Key=<key_string> directly to start the service.
The /AllowNetworkAccess option allows network access to emulator service. Its basically sets host to '0.0.0.0' instead of '127.0.0.1'(or localhost). Need to provide /KeyFile or Key option along with option.
The /Key=<key_string> can be used while starting the service with previously generated token/key by command run with /GenKeyFile option. The default key for local emulator is: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== and can be used along with /AllowNetworkAccess option for default connection key.
The /EnableMongoDbEndpoint enables listening port for MongoDb. Only then you can access the database with MongoDB features in the emulator service through Mongo DB connection string.
Below is the full command to start the service with remote access on LAN:
C:\Program Files\Azure Cosmos DB Emulator>Microsoft.Azure.Cosmos.Emulator.exe /AllowNetworkAccess /EnableMongoDbEndpoint /Key=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==