I know Azure release pipelines can deploy to on-premise servers and other cloud VMs. My pom.xml file enables Maven to create a .jar file. My Azure build uses this pom.xml file. The Azure build works fine by itself; there are no errors when it runs. I want to place the .jar file on to a Linux server via either the same Azure build pipeline job or a different Azure Release Pipeline. How do I do this?

I've looked at documentation. When I changed the build with a pathToPublish: stanza in my Azure build job, the job completes, but there is a warning:

[warning]Directory '/home/vsts/work/1/a' is empty. Nothing will be added to build artifact 'MyBuildOutputs'.

I don't see how "publishWebProjects" would be relevant. Nothing I am doing is relevant to the web.

When I try to create a new and separate release pipeline in Azure (that will hopefully include the same build pipeline job), the different stages that I choose from never involve deploying to a VM. Plus none of the options are obvious to me as to how to configure a source (i.e., to use the .jar file from the previous step a build job). Maybe the source defaults to the Artifact thus created by the Maven build job that I configured. In the Pipeline job I configured a Git repo as an Artifact, but I am not 100% sure Azure knows I want the .jar file that it can produce with Maven to be the artifact to be deployed as the source of the pipeline job itself. Which Template, in the Pipeline options for a given stage, do I choose as the stage in a new release pipeline to move a .jar file to a Linux server?

1 Answer 1


You have two basic scenarios:

  1. you have an Azure Pipelines agent running on the target machine
  2. you have an SSH connection to the target machine

In the first case you just cp the file to the target location (given that the user running the agent has adequate permissions). In the second case, you use a task like Copy Files Over SSH task to copy the file. For this latter you have to setup an SSH service connection in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.