PublishPipelineArtifact@0 fails with "API resource location not registered"

Viewed 1313

We are using Azure DevOps Server 2019.1.1 with current agent version: '2.153.1'

I'm trying to build a staged build/test/publish yaml. After the build I'd like to publish the artifact to the pipeline, because testing has special requirements and should/could be run on a dedicated agent.

The task inside that stage/job:

      - task: PublishPipelineArtifact@0
        inputs:
          artifactName: ReadyBuilt
          targetPath: $(OutputDirectory)

(Sidenote: I can't use PublishPipelineArtifact@1 from the online documentation, as our version is on premise and doesn't support it yet.)

It results in packing but fails on publishing.

##[section]Starting: PublishPipelineArtifact
==============================================================================
Task         : Publish Pipeline Artifact
Description  : Publish Pipeline Artifact
Version      : 0.139.0
Author       : Microsoft Corporation
Help         : Publish a local directory or file as a named artifact for the current pipeline.
==============================================================================
Uploading pipeline artifact from C:\work\tfs-agent\_work\23\s\Project\build for build #8348
Information, DedupManifestArtifactClient will correlate http requests with X-TFS-Session a0724b96-007e-48e5-861a-da10242fffce
Information, 347 files to be processed in 4 groups.
Information, 47 out of 347 files processed (Group: 4/4)
Information, 147 out of 347 files processed (Group: 1/4)
Information, 247 out of 347 files processed (Group: 3/4)
Information, 347 out of 347 files processed (Group: 2/4)
Information, Processed 347 files from C:\work\tfs-agent\_work\23\s\Project\build successfully.
Information, Uploading 347 files from: C:\work\tfs-agent\_work\23\s\Project\build
Information, Uploaded 0.0 MB out of 304.8 MB.
##[error]API resource location 53e6e1e0-[...] is not registered on https://azuredevsrv/DefaultCollection/.
##[section]Finishing: PublishPipelineArtifact

What am I missing here?

2 Answers

The PublishPipelineArtifacts is not supported on Azure Devop 2019 Update 1.1. Only in the cloud service. You can use what @shamrai-aleksander proposed.

enter image description here

I have the same issue and I`ve added a new ticket to the developers community: https://developercommunity.visualstudio.com/content/problem/937338/publishpipelineartifact-fails-with-message-api-res.html.

As workaround. You can use PublishBuildArtifacts task with CopyFiles task.

The example for .net:

- task: CopyFiles@2
  inputs:
    SourceFolder: '$(build.sourcesdirectory)'
    Contents: '**\bin\$(BuildConfiguration)\**'
    TargetFolder: '$(build.artifactstagingdirectory)'

- task: PublishBuildArtifacts@1
  inputs:
     publishLocation: Container
Related