Azure Pipelines Release
Agent Version: 2.141.1
OS: Hosted Ubuntu 1604 and Hosted VS2017
Pipeline artifact cannot be uploaded from release pipeline.
From documentation: Use this task in a build or release pipeline to publish pipeline artifacts to Azure Pipelines.
I try to combine multiple build artifacts into a single pipeline artifact, that can be used by later stages. All files are copied into $(System.DefaultWorkingDirectory)/application, which is also set as "path to publish". I also tried other directories under $(Agent.WorkFolder), same result.
2018-11-09T12:58:37.0965386Z ==============================================================================
2018-11-09T12:58:37.0965460Z Task : Publish Pipeline Artifact
2018-11-09T12:58:37.0965719Z Description : Publish Pipeline Artifact
2018-11-09T12:58:37.0965769Z Version : 0.139.0
2018-11-09T12:58:37.0965802Z Author : Microsoft Corporation
2018-11-09T12:58:37.0966013Z Help : Publish a local directory or file as a named artifact for the current pipeline.
2018-11-09T12:58:37.0966068Z ==============================================================================
2018-11-09T12:58:37.5744150Z ##[error]System.InvalidOperationException: Cannot upload to a pipeline artifact from release environment.
at Agent.Plugins.PipelineArtifact.PublishPipelineArtifactTask.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, String targetPath, String artifactName, CancellationToken token)
at Agent.Plugins.PipelineArtifact.PipelineArtifactTaskPluginBase.RunAsync(AgentTaskPluginExecutionContext context, CancellationToken token)
at Agent.PluginHost.Program.Main(String[] args)
I encounter the same issue:
2018-11-22T10:49:53.1144549Z ##[section]Starting: Publish Pipeline Artifact
2018-11-22T10:49:53.1147343Z ==============================================================================
2018-11-22T10:49:53.1147400Z Task : Publish Pipeline Artifact
2018-11-22T10:49:53.1147434Z Description : Publish Pipeline Artifact
2018-11-22T10:49:53.1147486Z Version : 0.139.0
2018-11-22T10:49:53.1147518Z Author : Microsoft Corporation
2018-11-22T10:49:53.1147550Z Help : Publish a local directory or file as a named artifact for the current pipeline.
2018-11-22T10:49:53.1147583Z ==============================================================================
2018-11-22T10:49:53.6900040Z ##[error]System.InvalidOperationException: Cannot upload to a pipeline artifact from release environment.
at Agent.Plugins.PipelineArtifact.PublishPipelineArtifactTask.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, String targetPath, String artifactName, CancellationToken token)
at Agent.Plugins.PipelineArtifact.PipelineArtifactTaskPluginBase.RunAsync(AgentTaskPluginExecutionContext context, CancellationToken token)
at Agent.PluginHost.Program.Main(String[] args)
2018-11-22T10:49:53.6930046Z ##[section]Finishing: Publish Pipeline Artifact
Hi @rstabenow, @koreyba,
if you check directly code that is executed, then you can see the Publish Pipeline Artifact task works only for Build pipelines.
I was a bit sad after this discovery, as we are waiting for publish artifact from release pipeline for ages.
I am also looking forward to seeing this happening. We have many customers who want to publish artifacts at release time.
I have a number of customers who want this functionality :/
Why doesn't this work in a Release? The documentation here https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact?view=vsts clearly states:
Use this task in a build or release pipeline to publish pipeline artifacts to Azure Pipelines.
It doesn't work with a release pipeline... at the top of the task log when running
"Publish a local directory or file as a named artifact for the current pipeline."
Hi folks - we'll correct the documentation. We would also like to be able to associate artifacts with the release pipeline but it doesn't have the necessary APIs to associate artifacts (of any type).
Assuming this has not been resolved yet; the documentation on this page is also misleading: https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azdevops&tabs=yaml
I thought that this was an improvement over the previous publish task..
Still not able to create artifacts from releases, which I need to create installers and setup scripts with specific configuration for environments.
@fleed unfortunately Release pipelines don't have the ability to have artifacts associated with them in general (other than artifacts that you feed in as inputs to a pipeline).
Closing this issue for now since not being able to publish artifacts in a Release pipeline is by design. We do have a bug around auto-injecting the download task into an RM pipeline (it injects, but the path defaults are wrong) - but that is a separate issue.
We need to be able publish functional test results from release pipelines, how do we go about doing that?
@petenorth if it is just a place to store your test results (given that you can't import them using the Publish Test Results task), maybe the ##vso[task.uploadfile] command is something for you. More information in this stackoverflow question.
I dont get this... people clearly what the feature, and have asked for this and but no new ticket is created and the issue gets closed as the current feature is working by design (which its not).
I also need this feature but i cant see way this isnt a feature out of the box.
I need this feature. I think everyone who knows CI will need this.
Well I spent 30 mins making a new release pipeline in our Azure DevOps 2019 Server to package up all our various build artifacts into one zip file that we can release to our customer. Only to not be able to upload that zip file.
I need this in a release pipeline since I need all the artifacts from different build pipelines. As a workaround, I'm doing a file copy to our dev web server's drop folder, to which I then remote into and transfer back to my computer, so we can give our customer a release.
I suppose I could do a build pipeline and add "Download Pipeline Artifacts" tasks but that's more cumbersome and error-prone than what I'm doing now.
We'd also like this.
Just put your build and release in your Pipeline build. You can always download your artifacts after the build.
@marcelopontipedra but you're sure you understand the purpose of separating build and release pipelines? When I see that this feature does not exist, I'm not even sure if Microsoft/devops understands the need for it. Deploying software is not always just a matter of publishing something to azure...
Hi Thomas
It was an alternative way to finish my tasks. It was helpful for me, which I was able to give report for a 3 to 4hrs of build.
I understand the separation of build and release, but I need the reports. I only did it for only 3 months, then go back to "build and release".
My tasked was done, then everyone was happy. :)
We run functional testss (cypress) after we deploy a release. These tests produce screenshots/videos of failed tests. How can we view/access these files if a release pipeline is not allowed to publish anything?
Just do the same thing I've done. I hope Microsoft will allow this feature soon so we will do this alternative solution.
You mean releasing with a "build" pipeline? There are pros and cons to doing this. Personally I like a code (yaml) approach and dislike the drag&drop approach but releases are integrated into the whole DevOps experience and dropping them drops some interesting functionality.
Most helpful comment
Why doesn't this work in a Release? The documentation here https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact?view=vsts clearly states: