Skip to content

Add artifacts_download module and example for universal packages#763

Open
cataggar wants to merge 3 commits intomicrosoft:mainfrom
cataggar:download-artifact
Open

Add artifacts_download module and example for universal packages#763
cataggar wants to merge 3 commits intomicrosoft:mainfrom
cataggar:download-artifact

Conversation

@cataggar
Copy link
Copy Markdown
Member

@cataggar cataggar commented Mar 26, 2026

Summary

Fixed #330. Adds an artifacts_download module and example for downloading universal packages from Azure DevOps Artifacts. The module provides a Client/ClientBuilder using azure_core for HTTP, following the same patterns as other modules in the crate.

Download Protocol

The module implements a 5-step dedup-based download protocol:

  1. Service discoveryGET /{org}/_apis/ResourceAreas to find the packages and blob service URLs
  2. Package metadataGET {pkgsHost}/{project}/_packaging/{feed}/upack/packages/{name}/versions/{version} to get manifest and super-root IDs
  3. Blob URL resolutionPOST {blobHost}/_apis/dedup/urls to convert blob IDs into SAS-signed download URLs
  4. Manifest download — Fetch and parse the JSON manifest listing all files and their blob references
  5. Chunk download & decompression — For each file, resolve its dedup node, download content chunks, decompress, and concatenate

Usage

export ADO_TOKEN=
export ADO_ORGANIZATION=myorg
export ADO_PROJECT=myproject

cargo run --example download_artifact --features=artifacts_download -- \
  --feed my-feed \
  --name my-package \
  --version 1.0.0 \
  --path /tmp/output

Verification

Tested end-to-end against a real Azure DevOps feed. The downloaded file matches byte-for-byte against the output of az artifacts universal download.

cataggar and others added 3 commits March 24, 2026 16:18
Addresses microsoft#330: Adds a complete example demonstrating how to download
universal packages from Azure DevOps Artifacts, plus an
artifacts_download module with the reusable protocol implementation.

The download protocol involves:

1. Service discovery via ResourceAreas API
2. Package metadata retrieval from the packages service
3. Blob URL resolution via the dedup service
4. Manifest download and parsing
5. Chunk download with xpress decompression
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

download universal artifacts

1 participant