7

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?

riQQ
  • 9,878
  • 7
  • 49
  • 66
kumareloaded
  • 3,882
  • 14
  • 41
  • 58

2 Answers2

4

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.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 2
    Thanks Leo. It still makes me wonder why MS does not do publish artifact in release pipeline, I see no good reason to not have it. – kumareloaded Nov 18 '19 at 09:26
  • 1
    @kumareloaded, Full agree with you. When I check the source code, I found the code is **only for Build**, like `context.Output(StringUtil.Loc("UploadingPipelineArtifact", fullPath, buildId));`. Since I not the development engineer, I could not know the reason why it not support for Release, maybe block by the code implementation or queue task priority. That the reason why I helped submit that user voice, hope MS development team can implement it as soon as possible, at least explain the reasons and plans. Sorry for any inconvenience. – Leo Liu Nov 18 '19 at 09:47
  • 1
    How about an alternative? Is there any other approach with which we can see the artifact modified in release pipeline via a maven task? (without publishing an artifact) – kumareloaded Nov 18 '19 at 11:21
  • @kumareloaded, By maven task? I am afraid not. You can use the copy task to copy the artifact modified in release to a network share folder (like azure blob storage). – Leo Liu Nov 18 '19 at 11:32
  • @kumareloaded, Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance. – Leo Liu Nov 19 '19 at 01:43
  • The information was indeed helpful. But I'll wait for an alternative to get the artifacts on release pipeline and then have an answer accepted. Thanks! – kumareloaded Nov 20 '19 at 11:19
  • @kumareloaded, That is OK. Also hope this is a solution for this question. – Leo Liu Nov 28 '19 at 06:02
3

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

huserben
  • 1,034
  • 1
  • 10
  • 19