user2503480
user2503480

Reputation: 193

How do you downlod artifacts from a different project within the same organization in Azure Devops?

I have an azure devops yaml pipeline in project A trying to download an artifact in project B within the same organization. It uses the DownloadBuildArtifacts@0 task as configured below:

 - task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'specific'
    project: 'f0a63c0e-a678-44ea-92f4-490def403add'
    pipeline: '38'
    buildVersionToDownload: 'latest'
    downloadType: 'single'
    artifactName: 'drop'
    downloadPath: '$(System.ArtifactsDirectory)/Common'

Where 'f0a63c0e-a678-44ea-92f4-490def403add' is the project id of Project B and 38 is the build pipeline defintion id producing the artifact in Project B. This works fine when executed in a pipeline within Project B. But fails with error below when I try to run the same task from a pipeline in Project A.

##[error]Failed in getBuildId with error: Error: VS800075: The project with id 'vstfs:///Classification/TeamProject/f0a63c0e-a678-44ea-92f4-490def403add' does not exist, or you do not have permission to access it.
##[error]Error: VS800075: The project with id 'vstfs:///Classification/TeamProject/f0a63c0e-a678-44ea-92f4-490def403add' does not exist, or you do not have permission to access it.
Finishing: DownloadBuildArtifacts

It looks like Project A has no access to Project B. Where and how do I set these permissions?

UPDATE: I checked "Limit job authorization scope to current project" option as advised in this post https://github.com/MicrosoftDocs/azure-devops-docs/issues/6790 but it was disabled. So not sure what other settings are needed.

Upvotes: 1

Views: 2676

Answers (1)

user2503480
user2503480

Reputation: 193

Actually the option "Limit job authorization scope to current project" as explain in this post is the answer https://github.com/MicrosoftDocs/azure-devops-docs/issues/6790. I was just disabling it in one of the pipelines. As soon as I set it in both pipelines it started working. FYI The same setting option exists at the organization level.

Upvotes: 1

Related Questions