3
votes

I have a java application and am trying to use Azure DevOps to build and deploy. Am able to do a build and publish the artifact in the build pipeline. In the release pipeline, I stages (dev/train/prod) in each stage I have a maven task to detokenize the build specific to the environment which I am able to do but I want to publish it as a artifact similar to the one in build pipeline. Is there any task to do that or any other alternate approach?

2

2 Answers

4
votes

Can we publish artifacts in release pipeline - Azure devOps?

Sorry for any inconvenience.

This behavior is by designed and MS replied they don't have plans to support uploading folder/artifacts from release in near future.

When you check the document Publish Pipeline Artifacts task, It stated that:

Use this task in a pipeline to publish artifacts for the Azure Pipeline (note that publishing is NOT supported in release pipelines. It is supported in multi stage pipelines, build pipelines, and yaml pipelines).

And if you check directly code that is executed, then you can see the Publish Pipeline Artifact task works only for Build pipelines.

You could check this ticket on github for some more details, many communities are waiting for publish artifact from release pipeline.

So, I helped you add a request for this feature on our UserVoice site, which is our main forum for product suggestions:

https://developercommunity.visualstudio.com/idea/823829/support-publish-artifact-from-release-pipeline.html

You could vote and add your comments for this feedback. When there are enough communities vote and add comments for this feedback, the product team member will take this feedback seriously.

Hope this helps.

1
votes

I was facing the same problem: I wanted to upload artifacts in a release pipeline and in a later agent phase download those artifacts again.

Based on some answers from a related SO Post I created an Extension that offers the possibility to:

  • Upload a file or a folder to the Release Logs
  • Automatically download an Artifact from the logs that was previously uploaded

The upload task is making use of the built-in logging command to add files to the Release Logs. The download task then queries the Azure DevOps REST Api to download all logs collected thus far, tries to find the specified artifact and copies it to a specific place.

If anyone is interested, it can be found on the Marketplace