Ever needed to deploy a Windows Service onto a machine with Azure DevOps? It turns out this is really easy (some caveat’s apply 😄, see section at the bottom)!
There is an extension on the Azure DevOps Marketplace that is a wrapper around the SC tool from Windows:
Add the extension and perform the tasks that you need:
In this case, I use these tasks:
- delete the existing service (will fail on the first try when the service is not available!)
- copy the files to the destination path
- set up the parameters for that server
- install the service on the remote server
There are some small caveats to get this to work:
- WinRM needs to be enabled on the target server.
- This extension cannot use the standard service user accounts to run the service as. This means you are tied to local user accounts on the target server and cannot use
Local System or
- Only works for X64 server and installed agent.