I've inherited maintenance of a .Net app that interfaces with our DevOps instance allowing developers to obtain build artifacts from our build pipelines and install appx's to local devices.
The app uses various clients available from Microsoft.TeamFoundation
namespaces, in particular BuildHttpClient
(ref), to pull down an artifact zip file, and then processes it locally. I would prefer to pull down only the relevant appx and dependency files, but this doesn't seem to be possible, unless anyone knows differently?
I note that the web-based DevOps artifact browser itself will allow download on a per-file basis, but I don't see that this is exposed anywhere...
You can use Rest API call instead of the SDK, there is an Artifacts - Get File API:
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&fileId={fileId}&fileName={fileName}&api-version=5.1
Maybe it will work only with Publish pipelines artifacts task and not with Publish build pipeline task, see here.