Azure CLI - Get newest package from a view (az artifacts universal download)?

2.5k Views Asked by At

Using az artifacts universal download, how can I download the latest package under a specific view in a feed, e.g. @Prerelease?

I can't seem to find any documentation on how to specify the view

Edit - Requests:

User Voice Request: https://developercommunity.visualstudio.com/idea/1195670/azure-cli-extensions-support-for-specifying-releas.html

Github Issue: https://github.com/Azure/azure-cli-extensions/issues/2330

5

There are 5 best solutions below

0
On BEST ANSWER

You can add the View to the feed specified:

e.g. --feed "Contoso@TheView"

0
On

I am afraid it is not yet supported to download package under a specific view in the feed. There is not a parameter to specify the view.

You have to find the package's latest version under a specific view in the UI page. And download the package by specifying the version.

You can also submit a user voice to Microsoft development team. Hope they will consider supporting this feature in the future sprint.

0
On

It does not seem to support downloading packages from the UI at the moment, you can only download using Azure CLI.

You must use the Azure CLI to download the package. Azure DevOps doesn't support direct HTTP/HTTPS download links or other ways to download the package.

You can put forward your suggestion here, or vote on it.

2
On

I just opened the documentation and you can put

version: '*.*.*'

and get the latest artifact

0
On

full task:

- task: UniversalPackages@0
  displayName: Download Universal Package
  inputs:
   command: download
   vstsFeed: "my-project/my-feed-name@Release"
   vstsFeedPackage: "my-package"
   vstsPackageVersion: '*' # download latest version
   downloadDirectory: $(Build.SourcesDirectory)

You can test all this locally (doc):

az artifacts universal download --organization "https://dev.azure.com/my-org-name" --feed "my-feed-name@Release" --project "my-project" --scope project --name "my-package" --version "*" --path "C:\Projects"

az artifacts universal publish --organization "https://dev.azure.com/my-org-name" --feed "my-feed-name" --project "my-project" --scope project --name "my-package" --version "0.0.3" --path "C:\Projects"

To promote to a view you can use the UI too.