Date posted: 23 Oct 2019, 0 minutes to read

Deploy Windows Service using Azure DevOps

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:
Azure DevOps screenshot

Add the extension and perform the tasks that you need:
Azure DevOps screenshot

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

Caveats

There are some small caveats to get this to work:

  1. WinRM needs to be enabled on the target server.
  2. 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 Network Service.
  3. Only works for X64 server and installed agent.