Edit

UniversalPackages@1 - Universal Packages v1 task

Use this task to publish or download Universal Packages to and from Azure Artifacts feeds. This version supports Workload Identity Federation (WIF) through Azure DevOps service connections, enabling authentication without Personal Access Tokens (PATs).

Syntax

# Universal Packages v1
# Download or publish Universal Packages.
- task: UniversalPackages@1
  inputs:
    command: 'download' # 'download' | 'publish'. Required. Command. Default: download.
    #workloadIdentityServiceConnection: # string. Alias: adoServiceConnection | azureDevOpsServiceConnection. Azure DevOps Service Connection. 
    #organization: # string. Optional. Use when adoServiceConnection != ''. Organization. 
    feed: # string. Required. Feed. 
    packageName: # string. Required. Package name. 
    #packageVersion: # string. Package version. 
    #versionIncrement: # 'major' | 'minor' | 'patch'. Optional. Use when command = publish. Version increment. 
    directory: '$(System.DefaultWorkingDirectory)' # string. Required. Directory. Default: $(System.DefaultWorkingDirectory).
    #packageDescription: # string. Optional. Use when command = publish. Description.

Inputs

command - Command
string. Required. Allowed values: download, publish. Default value: download.

Specifies the Universal Package command to run: download a package from a feed, or publish a package to a feed.


workloadIdentityServiceConnection - Azure DevOps Service Connection
Input alias: adoServiceConnection | azureDevOpsServiceConnection. string.

The name of an Azure DevOps Service Connection that uses Workload Identity Federation (WIF) for authentication. When specified, the task uses the service connection identity instead of the pipeline's build service identity. This enables scenarios such as cross-organization feed access and WIF-based authentication without PATs.

When not specified, the task authenticates using the pipeline’s built‑in build service identity. See Setting up an Azure DevOps Service Connection for setup instructions.


organization - Organization
string. Optional. Use when adoServiceConnection != ''.

The name of the Azure DevOps organization that hosts the target feed. Use this input when the feed is in a different organization than the one running the pipeline.

If not specified, the task uses the current pipeline’s organization.


feed - Feed
string. Required.

The name of the Azure Artifacts feed. For organization-scoped feeds, specify only the feed name. For project-scoped feeds, use the format project/feed, where project is the project name and feed is the feed name.


packageName - Package name
string. Required.

The name of the Universal Package to download or publish. Package names must be lower case and can only use letters, numbers, and dashes -.


packageVersion - Package version
string.

The version of the package. Required for download. For publish, specify either this input or versionIncrement, but not both.

For downloads, this can be a wildcard expression such as * to get the latest version, 1.* to get the latest version with major version 1, or 1.2.* to get the latest patch release with major version 1 and minor version 2. Wildcard patterns are not supported for pre-release packages.


versionIncrement - Version increment
string. Optional. Use when command = publish. Allowed values: major, minor, patch.

Automatically increments the package version. The task queries the feed for the latest existing version of the package and increments the specified component. Cannot be used together with packageVersion.

For new packages with no existing versions in the feed, the starting version is:

  • major: 1.0.0
  • minor: 0.1.0
  • patch: 0.0.1

directory - Directory
string. Required. Default value: $(System.DefaultWorkingDirectory).

For downloads, specifies the folder path where the package contents will be downloaded. For publish, specifies the path to the directory that contains the files to publish.


packageDescription - Description
string. Optional. Use when command = publish.

Description of the package contents and/or the changes included in this version of the package.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.

packageName
The name of the published package. Only set when command is publish.

packageVersion
The version of the published package. Only set when command is publish. Especially useful with versionIncrement, where the version is computed at runtime.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 4.248.0 or greater
Task category Package