0

I am using the below command to download artifacts

az rest --url "https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&api-version=6.1-preview.5"

But this gives an error

Can't derive appropriate Azure AD resource from --url to acquire an access token. If access token is required, use --resource to specify the resource

I am new to Azure DevOps and doesn't have any support. I don't know what this resource is. I tried giving --resource "latest" but then it gives an error

The resource principal named tenant was not found in tenant named ...

Please help me here

1 Answers1

0

You can use the below Azure CLI command to download the Artifacts As below:

az pipelines runs artifact download --artifact-name 'WebApp' --path $(System.DefaultWorkingDirectory)/bin/WebApp --run-id '<run id here>'

Refer this article to find the arguments.

Download artifacts produced by the current pipeline run, or from a specific pipeline run. Options: current, specific
Default value: current Argument aliases: buildType

Please refer the below links for further details To Publish & download latest azure pipeline artifacts and please find the similar thread How to download the latest build artifacts from Azure DevOps programmatically.

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15