azure-devopsmsbuildazure-pipelineswebdeploymsdeploy

How to deploy/reference built files in Azure DevOps Pipeline?


I have created a pipeline in Azure DevOps. First it restores Nuget, then it builds the solution with the following arguments:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)\\" /p:IncludeSetAclProviderOnDestination=False 

This all works fine. The next task is to publish to my Azure App Service and I use a MSDeploy Package Sync task to do this. I do not know what to set the 'Web Deploy Package' field to, in order for it to pick up the artefacts built. When I run the pipeline it always fails on that task with a DirectoryNotFound exception.

Please can someone advise how I should reference to the path where my files are built, or point me to a place where I can learn about paths on my build server.


Solution

  • How to deploy/reference built files in Azure DevOps Pipeline?

    You need also add the Publish build artifacts task to publish build artifacts to Azure Pipelines.

    enter image description here

    Then create a new release pipeline with the build artifact as source artifact:

    enter image description here