Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List files of a build artifact

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.

like image 689
Rémi Benoit Avatar asked Dec 03 '18 10:12

Rémi Benoit


Video Answer


1 Answers

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
like image 197
Fairoz Avatar answered Nov 15 '22 07:11

Fairoz