Configuring Octopus Deploy Server using DSC


I have written a DSC Resource to configure the Octopus Deploy Sever, however it does not execute properly. For example the following command:

"C:\Program Files\Octopus Deploy\Octopus\Octopus.Server.exe" create-instance -instance "Octopus" -config "C:\Octopus\OctopusServer.config"

Gives the following error.

Octopus Deploy: Server version (3.0.21+Branch.master.Sha.0e1cba56572aebc9e51f36c9d656496557991112)
Cannot start service from the command line or a debugger.  A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.

However the same command, when run from a console works without issue. The DSC uses the same idea from your DSC resource for installing Tentacles, namely the Invoke-AndAssert function.

I have built up a complete with all the commands that need to be run to configure the instance and each one throws the error above. The script when run in a console correctly configures the instance. It seems there is an issue when the Octopus.Server.exe when it is run within DSC.

Has anyone else had experience of this and managed to solve it at all?

Thanks, Russell

Hi Rusell,

Thanks for reaching out. Please add the switch --console to your Octopus.server.exe call and try again. This switch tells the app NOT to run as a service, which is apparently causing this issue.