8

I've seen that in the 5.0 preview of the REST API it seems possible to download a specific file from a build artifact using :

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&fileId={fileId}&fileName={fileName}&api-version=5.0-preview.5

But how to list the files of an artifact ? I don't know what to input for fileId.

My usecase is a folder archived as an artifact during the build. I would like to get download links for each files in the folder.

Rémi Benoit
  • 1,307
  • 11
  • 17

1 Answers1

2

I found that the API you using is not having complete documentation.

I used below to download specific file from Build artifacts using PowerShell. You could get the container ID from GET build details.

https://$collectionurl/tfs/$teamproject/_apis/resources/Containers/$containerID?itemPath=drop%filename.txt
Fairoz
  • 828
  • 2
  • 8
  • 21