0
votes

I cannot use the Publish Build Artifacts Task in a release-definition, I'm getting the following error:

  • ErrorHostTypeNotSupported: This task must run in a build to publish artifacts to Visual Studio Team Services/TFS.

So my question is:

  • How can I save a file from a release-definition?

Why I want to achieve this:

  • I'm using a Deploy to Kubernetes Task in my release definition (which deploys a microservice with a yaml file to azure aks), this yaml file is tokenized during the release (I'm replacing the build-id). So at the end, I want to be able to download this file for each release and to use it for a manual deployment (if necessary).

Thanks for your help.

1
Publish it as an artifact in your build?Daniel Mann
As Eddie said that the better way is using uploadfile logging command.starian chen-MSFT

1 Answers

3
votes

There is no container for artifacts in Release Management, so you cannot use that task in Release.

As a workaround, you can use ##vso[task.uploadfile]local file path command in VSTS Task Logging Command to upload the file.

Upload user interested file as additional log information to the current timeline record. The file shall be available for download along with task logs.

To do this, add a powershell task in your release definition like below: enter image description here When you want to use the file, download the release logs as zip, the file will be included in it.