Install an Unlocked Package to an org

Deployment Tasks

Task Id




This task is a wrapper over sfdx force:package:install command along with function to deploy artifacts generated by Create a new version of Unlocked Package task, as well as by passing in the package Id. This task is meant to be used in Release Pipeline


Install SFDX CLI with sfpowerkit must be added to the pipeline before utilizing this task

Task Snapshot


Input Parameters
Output Parameters
YAML Example
Input Parameters

Classic Designer Labels are in Bold, YAML Variables are in italics

  • Alias or username of the target org / target_org

    Provide the alias or username of the target org on which the unlocked package is to be deployed

  • Name of the package to be installed / package

    Name of the package to be installed

  • Package to be installed From / packageinstalledfrom The provider for the particular artifact that is attached to the pipeline, The task supports these possible values

    - From Artifact / Artifact: If you want to use an artifact - Path to the directory where artifacts are downloaded / artifactDir : Provide the path of the directory where the artifacts will be unpacked, By default the task will pick up the Pipeline.Workspace (in case of YAML Pipelines) or System.ArtifactsDirectory (in case of Classic Pipelines). This is enabled only if packageinstalledfrom is Artifact - Custom / Custom: If you want to pass in the package_version_id manually, such as using this task to install managed packages or a previously built package - Package Version Id / package_version_id: Only enabled if the above option (Package to be installed from is Custom), pass the version id of the package

  • Name of the artifact (source alias ) that is attached to this release pipeline / artifact The source alias of the artifact that is attached to this release pipeline. Please note it will only accept artifact generated by Create SFDX Unlocked Package

  • Installation Key (installationkey)

    Installation key for the package version to be installed

  • Compile Apex from only the package / apexcompileonlypackage

    Specifies whether to compile all Apex in the org and package, or only the Apex in the package.

  • Security access type for the installed package / security_type

    Security access type for the installed package, Permissible values are: - AllUsers / AllUsers : If the unlocked package is to be installed for all users - AdminsOnly / AdminsOnly: If the unlocked package is to be installed for admins only

  • Upgrade type for the installed package / upgrade_type

    Upgrade type for the package to be installed, Permissible values are: - Mixed / Mixed - DeprecateOnly / DeprecateOnly - Delete / Delete From the CLI Help, "For package upgrades, specifies whether to mark all removed components as deprecated (DeprecateOnly), to delete removed components that can be safely deleted and deprecate the others (Mixed), or to delete all removed components, except for custom objects and custom fields, that don't have dependencies (Delete). The default is Mixed. Can specify DeprecateOnly or Delete only for unlocked package upgrades."

  • Wait Time / wait_time

    Wait time for the command to finish in minutes

  • Publish Wait Time / publish_wait_time

    Wait time for the command to wait for the created package to be available in the org, before it can be installed

  • Skip if the package is already installed in the org / skip_if_package_installed

    Skip installation of the package if it is already installed in the org

  • Skip if no artifact is found / skip_on_missing_artifact Once enabled, the task will be skipped if the artifact mentioned is not attached to the release pipeline. This option is useful if the artifacts are attached to the release pipeline dynamically

Output Parameters

YAML Example
- task: [email protected]<version>
displayName: Deploy <MyPackage> to <alias>
target_org: <alias>
package: <MyPackage>
packageinstalledfrom: 'Artifact'
package_version_id: $(CIPackageCreate.sfpowerscripts_package_version_id)
security_type: 'AdminsOnly'
upgrade_type: 'Mixed'


  • 11.0.5 Refactor artifact structure #131, remove artifact type and source alias input parameters #151

  • 10.0.3 #98 Skip installation if already installed

  • 9.2.0

    • Removed Telemetry Collection

    • Added support for Azure Artifacts

    • Added support for skipping task if specified artifact is not found

  • 8.0.9 Refactored to use revamped folder structure

  • 7.0.4 Support for installation of packages of a build that generate multiple artifacts such as MonoRepo

  • 6.0.0 Fix labels and help description

  • 5.0.1 Updated with Telemetry

  • 4.1.0 Initial Version

Edit on GitHub