question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish Build Artifacts does not work on release definition

See original GitHub issue

The utility task Publish Build Artifacts doesn’t appear to work correctly. I’ve created a simple repro scenario to demonstrate. The cause I can initially think of is that this is running via the on-prem Agent, but I don’t think that should matter because it just downloads files locally then uploads/publishes the local artifacts back to the server.

The ultimate error I get is:

2017-01-10T19:32:05.2129999Z ##[error]Unable to process command '##vso[artifact.upload artifacttype=container;artifactname=MyLogsArtifactName;containerfolder=MyLogsArtifactName;localpath=C:\agent\_work\r2\a\UploadLogFiles\MyLogs;]C:\agent\_work\r2\a\UploadLogFiles\MyLogs' successfully. Please reference documentaion (http://go.microsoft.com/fwlink/?LinkId=817296)
 
2017-01-10T19:32:05.2159990Z ##[error]Value cannot be null.

Steps to reproduce

Initial Setup

Create C:\Temp\VSTS directory and add two dummy files “Test2File.txt” and “TestUploadFile.log”. These represent misc logs that may be collected during a build. image

Build Definition

Create a single PowerShell build step with “Type=Inline Script” and use the following code (see screenshot too):

Write-Host "##vso[artifact.upload containerfolder=MyLogs;artifactname=MyLogs;]C:\TEMP\VSTS\Test2File.txt"
Write-Host "##vso[artifact.upload containerfolder=MyLogs;artifactname=MyLogs;]C:\TEMP\VSTS\TestUploadFile.log"

Write-Output "Uploaded 2 files..."

image

Run this build! And explore/verify the files were uploaded correctly (see screenshot). image

Release Definition

Create a new, simple release definition according to the following screenshot, where you select the “Path to Publish” as the directory from the build step. Choose “Server” for artifact type.

image

Run this release and you’ll receive something similar to the error below:

2017-01-10T19:32:04.9330002Z ##[section]Starting: Publish Artifact: MyLogsArtifactName
 
2017-01-10T19:32:04.9599998Z ==============================================================================
 
2017-01-10T19:32:04.9599998Z Task         : Publish Build Artifacts
 
2017-01-10T19:32:04.9599998Z Description  : Publish Build artifacts to the server or a file share
 
2017-01-10T19:32:04.9599998Z Version      : 1.0.39
 
2017-01-10T19:32:04.9599998Z Author       : Microsoft Corporation
 
2017-01-10T19:32:04.9599998Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
 
2017-01-10T19:32:04.9599998Z ==============================================================================
 
2017-01-10T19:32:05.2129999Z ##[error]Unable to process command '##vso[artifact.upload artifacttype=container;artifactname=MyLogsArtifactName;containerfolder=MyLogsArtifactName;localpath=C:\agent\_work\r2\a\UploadLogFiles\MyLogs;]C:\agent\_work\r2\a\UploadLogFiles\MyLogs' successfully. Please reference documentaion (http://go.microsoft.com/fwlink/?LinkId=817296)
 
2017-01-10T19:32:05.2159990Z ##[error]Value cannot be null.
 
Parameter name: containerId
 
2017-01-10T19:32:05.2770001Z ##[section]Finishing: Publish Artifact: MyLogsArtifactName
 
 

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (10 by maintainers)

github_iconTop GitHub Comments

28reactions
GitHubSriramBcommented, Feb 1, 2017

That’s right. We currently don’t support publishing artifacts from a release.

17reactions
GitHubSriramBcommented, Aug 14, 2018

##vso[task.uploadfile] can be used to upload files to release. We don’t have plans to support uploading folder/artifacts from release in near future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PublishBuildArtifacts@1 - Publish build artifacts v1 task
Use this task in a build pipeline to publish build artifacts to Azure Pipelines, TFS, or a file share. Syntax. YAML Copy. # ......
Read more >
Can build code but "Release Pipeline" says no artifact was ...
Before run "No version is available for *** or the latest version has no artifacts to publish. This might fail deployment. Please check...
Read more >
Release is triggered even though build does not publish ...
The problem is that all our release pipelines are triggered when a build pipeline creates an artifact.
Read more >
Understanding Build and Pipeline Artifacts in Azure DevOps
Your browser can't play this video. Learn more. Switch camera.
Read more >
Publishing Artifacts in an Azure DevOps Release Pipeline
Since artifacts in each stage are not available to other stages, you must now ensure the upcoming deploy stage can get access to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found