Warm tip: This article is reproduced from stackoverflow.com, please click
azure-devops azure-pipelines continuous-deployment

How do you publish files back to VSTS Release Management as part of a release?

发布于 2020-04-11 22:46:20

I'm trying to upload log files created by a 3rd party exe during a deployment and including it in the results of my deployment, on a separate tab if possible.

I tried using the publish artifact build tasks but that only works for build not release.

I tried logging tasks but ##vso[build.uploadlog]<local file path> seems to be for builds as well since it complains about finding a container for the build.

Questioner
Francois
Viewed
92
Eddie Chen - MSFT 2016-07-21 11:04

Release management does not have a container for build artifacts, that's why you see this error message.

You can try with following task:

Write-host "##vso[task.uploadfile]<filename>"

View and download attachments associated with releases

Would you like to upload additional logs or diagnostics or images when running tasks in a release? This feature enables users to upload additional files during deployments. To upload a new file, use the following agent command in your script:

Write-host "##vso[task.uploadfile]"

The file is then available as part of the release logs. When you download all the logs associated with the release, you will be able to retrieve this file as well.

You can also add a powershell script task in your release definition to read the log files and output it to the console. Then you will be see the content of the log files from "Logs" tab powershell script step. And you can also click "Download all logs as zip" to download the logs. enter image description here

enter image description here