Uploading and downloading universal packages using the Azure CLI

When you want to work with universal packages from a product other than Azure Pipelines, you will have to use the Azure CLI. To do this, perform the following steps:

  1. The first thing you have to do to work with universal packages using the Azure CLI is to install the CLI itself. The link to the CLI can be found at the end of this chapter.
  2. Next, it is time to install the extension for Azure DevOps. This can be done using the following command:
az extension add –name azure-devops
  1. After making the extension for Azure DevOps available, you have to log in using the account that you also use to work within the Azure DevOps UI. You can log in by giving the following command:
az login
  1. Once logged in, you can upload a file as an artifact using the following command:
az artifacts universal publish 
--feed {yourFeedName}
--name {yourPackageName}
--version {yourVersion}
--organization https://dev.azure.com/{yourOrganizationName}
--path {sourceFileName}
  1. To download a particular version of an artifact again, you can use the following:
az artifacts universal download 
--feed {yourFeedName}
--name {yourPackageName}
--version {yourVersion}
--organization https://dev.azure.com/{yourOrganizationName}
--path {targetFileName}

Using the CLI and these commands, you can use Azure Artifacts as a means for sharing build artifacts between multiple tools. When working with a number of tools on the same project, Universal Packages are a great tool for moving binaries around.

In the next section, other tools available for package management will be explored.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.100.120