Set Windows Service Password For Environment in Octopus Deploy
The default Windows Service start-up feature in Octopus Deploy gives you a few options on which user you want the service to start as and you can supply a password if needed. Using the standard option you are restricted to using a single username and password for the deploy script (you could have multiple deploy stages but this is messy).
If you need to have the service run under a different user in different environments, this is a problem.
A simple solution is to use some project variables and a custom binding.
First, add some project variables for the user name and password and bind them to the environment or machine that you need (details here: http://docs.octopusdeploy.com/display/OD/Variables)
Secondly, go to your deploy step (this assumes you have the Windows Service feature enabled) and change the Service Account drop-down to Custom User... and then change the Custom account name to the variable you are using for the service name that you created before.
Next, click the Change password tick-box which will open the password text box (step 1 in the screenshot). To the right of this, and to the right of the variables selector, is the Custom Binding selector (step 2 in the screenshot). Click this which will change the password text box to a larger edit box (step 3 in the screenshot). Add the variable you are using for the password here.
Click save and have a cookie. You're done.