3

I am trying to run DocumentDB Emulator as a windows service using sc utility on a port which is different from the default port 8081 which it is trying to use.

sc create DocumentDBEmulatorService binPath= "path\to\exe\DocumentDB.Emulator.exe /port=8082" start= auto

The Service gets created and fails to start with the following error message

The DocumentDBEmulatorService service failed to start due to the following error.The DocumentDBEmulatorService did not respond to the start or control request in a timely fashion. A timeout was reached (30000 milliseconds) while waiting for DocumentDBEmulatorService service to connect.

Is it possible to run Document DB emulator executable as service or am I trying to something which is clearly not possible ?

hokkaidi
  • 858
  • 6
  • 19
Mamtha Soni K
  • 895
  • 6
  • 9
  • DocumentDB Emulator it seems to be used for the us to familar with azure documentdb and we can do some test in our local without any cost. In my opinion, it perhaps can't be installed as Window Service. – Tom Sun - MSFT May 12 '17 at 03:21

1 Answers1

1

sc will only run an executable which that is a proper Windows service (i.e. implement ServiceMain).

You can try something like NSSM instead.

See answers in this question (except the accepted one) for more options.

Community
  • 1
  • 1
Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107
  • I try to use NSSM to install the documentdb Emulator it can be installed successful but can't be started, and can't be remove from service list with command `nssm remove servicename confirm` – Tom Sun - MSFT May 12 '17 at 03:17