Download universal artifact from azure devops using cURL

355 Views Asked by At

I would like to download universal/UPack artifact from Azure devops artifactory. I am aware I can use Azure CLI but that means requirement to have Azure CLI installed, which is the very last resort.

I already achieved similar approach for maven artifacts but I am unable to figure out proper approach for the universal/UPack artifact.

Following code will get the latest version of maven artifact and download specific file in the package.

PKG_VERSION=$(curl -s -u $ARTIFACTORY_USERNAME:$ARTIFACTORY_PASSWORD "https://feeds.dev.azure.com/<ORGANISATION_NAME>/<PROJECT_ID>/_apis/packaging/feeds/<FEED_ID>/packages?packageNameQuery=<GROUP_NAME>:<ARTIFACT_ID>&api-version=6.0" | jq -r ".value[0].versions[0].normalizedVersion")

curl -u $ARTIFACTORY_USERNAME:$ARTIFACTORY_PERSONAL_ACCESS_TOKEN -o /app/boot.jar -L https://pkgs.dev.azure.com/<ORGANISATION_NAME>/<PROJECT_ID>/_apis/packaging/feeds/<FEED_ID>/maven/<GROUP_NAME>/<ARTIFACT_ID>/$PKG_VERSION/<JAR_FILE_NAME>/content

Is there a way to do similar thing to universal/UPack, with one extra condition: download whole content of that package, not just single file.

1

There are 1 best solutions below

0
On

Unlike other package types in Azure Artifacts, the Universal type packages do not have an available "Download Package" REST API can be used. So, you cannot use curl command to call a REST API to download Universal packages.

Currently, the only available method to download Universal packages is using the 'az artifacts universal download' command.


If your projects really need a REST API for Universal packages can be called by curl command to download Universal packages, I recommend you try to report a feature request on Developer Community. That will make it more convenient for the product teams to receive and understand your ideas. And your feedback also could be helpful for improving the Azure DevOps products.