- Overview
- Get started
- Concepts
- Using UiPath CLI
- How-to guides
- CI/CD recipes
- Command reference
- Overview
- Exit codes
- Global options
- uip codedagent
- uip coder
- uip context-grounding
- uip docsai
- uip function
- uip guardrails
- uip llm-configuration
- uip llm-gateway
- uip maestro authoring
- uip maestro registry
- uip model-hub
- uip ont
- activities find
- activities get-default-xaml
- analyze
- analyzer-rules list
- build
- cleanup
- data-fabric-entities install
- data-fabric-entities list
- files diff
- get-library-object-repository
- get-object-repository
- init
- instances list
- pack
- packages inspect
- packages install
- packages versions
- publish
- remote
- restore
- run, debug & execution
- settings
- studio start
- templates search
- test-data add-entity
- test-data add-queue
- test-data add-variation
- tm
- uia
- validate
- workflow-examples get
- workflow-examples list
- uip resources
- uip tasks
- uip traces
- uip traces feedback
- Migration
- Reference & support
CI/CD recipe: Azure Pipelines
Complete Azure Pipelines YAML for authenticating, packing, publishing, deploying a UiPath Solution, and running Test Manager tests.
This page gives you a complete azure-pipelines.yml that installs the CLI, authenticates with an External Application, packs and publishes a UiPath Solution, deploys it to Orchestrator, and runs a Test Manager suite against the deployment. The pipeline is self-contained: copy it into the root of your repo, wire two secrets, and it runs.
For the underlying principles — auth, caching, tool pre-install, version pinning — see How-to: deploy to Orchestrator from CI. This page focuses on the Azure Pipelines syntax.
Prerequisites
Before copying the YAML below:
- Create an External Application in UiPath with the
OR.*scopes your pipeline needs. See Authentication — Flow 2. - Store the secrets in an Azure DevOps variable group:
- Project Settings → Pipelines → Library → New variable group (for example,
uipath-prod). - Add
UIPATH_CLIENT_IDandUIPATH_CLIENT_SECRET— mark both as secret (padlock icon). - Optionally add
UIPATH_TENANT(not a secret).
- Project Settings → Pipelines → Library → New variable group (for example,
- Link the variable group to the pipeline (see the
variablesblock below). - Commit a frozen
.uipath/config.jsonat the repository root. The pipeline reads the CLI, tool, and skills versions from it. See Freezing a CI pipeline. - Provision a Test Manager project and test set (if you want the test stage). You will need the
TEST_SET_KEY(formatPROJECT:42) andPROJECT_KEY. See How-to: run tests from the CLI.
azure-pipelines.yml
trigger:
branches:
include: [ main ]
pr:
branches:
include: [ main ]
variables:
- group: uipath-prod # contains UIPATH_CLIENT_ID, UIPATH_CLIENT_SECRET
- name: NODE_VERSION
value: '22.x'
- name: SOLUTION_NAME
value: 'my-solution'
- name: DEPLOYMENT_NAME # the deployment's identity: keep it the same on every run
value: 'my-solution'
- name: SOLUTION_DIR
value: '$(Build.SourcesDirectory)/my-solution'
- name: OUTPUT_DIR
value: '$(Build.ArtifactStagingDirectory)'
- name: SOLUTION_VERSION
value: '1.2.0-ci.$(Build.BuildId)'
# Path where npm places globally-installed packages. Used to cache the CLI + tools.
- name: NPM_GLOBAL_CACHE
value: '$(HOME)/.npm-global/lib/node_modules'
stages:
- stage: Build
displayName: 'Pack the Solution'
jobs:
- job: pack
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
uip --version
displayName: 'Install UiPath CLI'
- script: |
set -euo pipefail
uip solution pack "$(SOLUTION_DIR)" "$(OUTPUT_DIR)" \
--name "$(SOLUTION_NAME)" \
--version "$(SOLUTION_VERSION)"
displayName: 'Pack Solution'
- publish: '$(OUTPUT_DIR)'
artifact: solution-zip
displayName: 'Publish artifact'
- stage: Deploy
displayName: 'Publish to feed and deploy to Orchestrator'
dependsOn: Build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # pull requests pack only
jobs:
- deployment: deploy
environment: 'uipath-prod' # Azure DevOps environment — gates / approvals live here
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
displayName: 'Install UiPath CLI'
- script: |
set -euo pipefail
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
displayName: 'Authenticate'
env:
UIPATH_CLIENT_ID: $(UIPATH_CLIENT_ID)
UIPATH_CLIENT_SECRET: $(UIPATH_CLIENT_SECRET)
UIPATH_TENANT: $(UIPATH_TENANT)
- download: current
artifact: solution-zip
- script: |
set -euo pipefail
ARTIFACT=$(find "$(Pipeline.Workspace)/solution-zip" -maxdepth 1 -name "*.zip" | head -1)
uip solution publish "$ARTIFACT"
displayName: 'Publish to tenant feed'
- script: |
set -euo pipefail
uip solution deploy run \
--name "$(DEPLOYMENT_NAME)" \
--package-name "$(SOLUTION_NAME)" \
--package-version "$(SOLUTION_VERSION)" \
--folder-name MySolution \
--parent-folder-path Shared
displayName: 'Deploy to Orchestrator'
- stage: Test
displayName: 'Run Test Manager suite'
dependsOn: Deploy
condition: and(succeeded(), ne(variables['TEST_SET_KEY'], ''))
jobs:
- job: test
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
displayName: 'Install + authenticate'
env:
UIPATH_CLIENT_ID: $(UIPATH_CLIENT_ID)
UIPATH_CLIENT_SECRET: $(UIPATH_CLIENT_SECRET)
UIPATH_TENANT: $(UIPATH_TENANT)
- script: |
set -euo pipefail
EXECUTION_ID=$(uip tm testsets run \
--test-set-key "$TEST_SET_KEY" \
--output-filter "ExecutionId" \
--output plain)
echo "started execution $EXECUTION_ID"
code=0
uip tm wait \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY" \
--timeout 1800 || code=$?
if [ "$code" -eq 4 ]; then
echo "##vso[task.logissue type=error]test run did not finish within 30 minutes"
exit 4
fi
uip tm report get \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY"
FAILED=$(uip tm report get \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY" \
--output-filter "Failed" \
--output plain)
if [ "$FAILED" -gt 0 ]; then
echo "##vso[task.logissue type=error]$FAILED test case(s) failed"
exit 1
fi
if [ "$code" -ne 0 ]; then
echo "##vso[task.logissue type=error]wait failed or the run was cancelled (exit $code)"
exit "$code"
fi
displayName: 'Launch, wait, verify'
env:
TEST_SET_KEY: $(TEST_SET_KEY)
PROJECT_KEY: $(PROJECT_KEY)
trigger:
branches:
include: [ main ]
pr:
branches:
include: [ main ]
variables:
- group: uipath-prod # contains UIPATH_CLIENT_ID, UIPATH_CLIENT_SECRET
- name: NODE_VERSION
value: '22.x'
- name: SOLUTION_NAME
value: 'my-solution'
- name: DEPLOYMENT_NAME # the deployment's identity: keep it the same on every run
value: 'my-solution'
- name: SOLUTION_DIR
value: '$(Build.SourcesDirectory)/my-solution'
- name: OUTPUT_DIR
value: '$(Build.ArtifactStagingDirectory)'
- name: SOLUTION_VERSION
value: '1.2.0-ci.$(Build.BuildId)'
# Path where npm places globally-installed packages. Used to cache the CLI + tools.
- name: NPM_GLOBAL_CACHE
value: '$(HOME)/.npm-global/lib/node_modules'
stages:
- stage: Build
displayName: 'Pack the Solution'
jobs:
- job: pack
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
uip --version
displayName: 'Install UiPath CLI'
- script: |
set -euo pipefail
uip solution pack "$(SOLUTION_DIR)" "$(OUTPUT_DIR)" \
--name "$(SOLUTION_NAME)" \
--version "$(SOLUTION_VERSION)"
displayName: 'Pack Solution'
- publish: '$(OUTPUT_DIR)'
artifact: solution-zip
displayName: 'Publish artifact'
- stage: Deploy
displayName: 'Publish to feed and deploy to Orchestrator'
dependsOn: Build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # pull requests pack only
jobs:
- deployment: deploy
environment: 'uipath-prod' # Azure DevOps environment — gates / approvals live here
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
displayName: 'Install UiPath CLI'
- script: |
set -euo pipefail
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
displayName: 'Authenticate'
env:
UIPATH_CLIENT_ID: $(UIPATH_CLIENT_ID)
UIPATH_CLIENT_SECRET: $(UIPATH_CLIENT_SECRET)
UIPATH_TENANT: $(UIPATH_TENANT)
- download: current
artifact: solution-zip
- script: |
set -euo pipefail
ARTIFACT=$(find "$(Pipeline.Workspace)/solution-zip" -maxdepth 1 -name "*.zip" | head -1)
uip solution publish "$ARTIFACT"
displayName: 'Publish to tenant feed'
- script: |
set -euo pipefail
uip solution deploy run \
--name "$(DEPLOYMENT_NAME)" \
--package-name "$(SOLUTION_NAME)" \
--package-version "$(SOLUTION_VERSION)" \
--folder-name MySolution \
--parent-folder-path Shared
displayName: 'Deploy to Orchestrator'
- stage: Test
displayName: 'Run Test Manager suite'
dependsOn: Deploy
condition: and(succeeded(), ne(variables['TEST_SET_KEY'], ''))
jobs:
- job: test
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node.js $(NODE_VERSION)'
inputs:
versionSpec: $(NODE_VERSION)
- task: Cache@2
displayName: 'Cache npm global (@uipath/cli)'
inputs:
key: 'uip | "$(Agent.OS)" | .uipath/config.json'
path: $(NPM_GLOBAL_CACHE)
- script: |
set -euo pipefail
export PATH="$HOME/.npm-global/bin:$PATH"
echo "##vso[task.prependpath]$HOME/.npm-global/bin"
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
if ! command -v uip >/dev/null; then
npm install -g "@uipath/cli@$CLI_PIN"
fi
uip update
uip login \
--client-id env.UIPATH_CLIENT_ID \
--client-secret env.UIPATH_CLIENT_SECRET \
--tenant "$UIPATH_TENANT"
displayName: 'Install + authenticate'
env:
UIPATH_CLIENT_ID: $(UIPATH_CLIENT_ID)
UIPATH_CLIENT_SECRET: $(UIPATH_CLIENT_SECRET)
UIPATH_TENANT: $(UIPATH_TENANT)
- script: |
set -euo pipefail
EXECUTION_ID=$(uip tm testsets run \
--test-set-key "$TEST_SET_KEY" \
--output-filter "ExecutionId" \
--output plain)
echo "started execution $EXECUTION_ID"
code=0
uip tm wait \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY" \
--timeout 1800 || code=$?
if [ "$code" -eq 4 ]; then
echo "##vso[task.logissue type=error]test run did not finish within 30 minutes"
exit 4
fi
uip tm report get \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY"
FAILED=$(uip tm report get \
--execution-id "$EXECUTION_ID" \
--project-key "$PROJECT_KEY" \
--output-filter "Failed" \
--output plain)
if [ "$FAILED" -gt 0 ]; then
echo "##vso[task.logissue type=error]$FAILED test case(s) failed"
exit 1
fi
if [ "$code" -ne 0 ]; then
echo "##vso[task.logissue type=error]wait failed or the run was cancelled (exit $code)"
exit "$code"
fi
displayName: 'Launch, wait, verify'
env:
TEST_SET_KEY: $(TEST_SET_KEY)
PROJECT_KEY: $(PROJECT_KEY)
Walkthrough
Stage 1 — Build
NodeTool@0pins Node.js to version 22. Pin to a major; the CLI requires 22+.Cache@2caches the npm globalnode_modulesdirectory. The cache key includes.uipath/config.json, whichCache@2hashes, so a change to the freeze invalidates cleanly.- Install step switches npm's global prefix to
$HOME/.npm-global(nosudoneeded), prepends it to the PATH, and — only if the cache missed — installs@uipath/cliat the version inversions.cli.uip updatethen puts the CLI and each pinned tool on their pins, so no explicituip tools installis needed. See Freezing a CI pipeline and Scripting patterns — pinning versions. - Pack step invokes
uip solution packwith an explicit--version(never rely on the1.0.0default in CI). publish: ...uploads the entire$(OUTPUT_DIR)as a pipeline artifact namedsolution-zipso the Deploy stage can consume it. Publishing the directory rather than a hardcoded filename keeps the recipe stable across CLI naming-convention changes.
Stage 2 — Deploy
Uses a deployment job bound to a named environment. Environments are where you configure gates and approvals in Azure DevOps — the YAML itself stays simple.
checkout: selfchecks out the repository. A deployment job does not check out by default, and the CLI reads the frozen.uipath/config.jsonfrom the current folder upward.- Re-installs the CLI (the cache should hit on the second stage of the same run).
uip loginuses theenv.VAR_NAMEprefix for both the client ID and secret. Theenv:block at the step level maps$(UIPATH_CLIENT_ID)(from the variable group) to the actual environment variableUIPATH_CLIENT_IDthat the flag resolves. Do not pass the secret literally on the command line (--client-secret "$(UIPATH_CLIENT_SECRET)") — that leaks it into the build log andpsoutput. Theenv.prefix feature is documented in Authentication — the env.VAR_NAME prefix.download: currentpulls thesolution-zipartifact from Stage 1 into$(Pipeline.Workspace)/solution-zip.uip solution publishuploads the.zipto the tenant feed.uip solution deploy runinstalls or updates the deployment. The deployment is keyed on--name, soDEPLOYMENT_NAMEstays the same on every run:- The first run creates the deployment and its folder,
Shared/MySolution. - Every later run upgrades that same deployment in place to the new version. The folder and the provisioned resources stay, and values already set on them (for example a credential asset's secret) are kept.
--folder-nameand--parent-folder-pathapply only to the first run. - Do not put
$(Build.BuildId)or a commit SHA in--name. Each new name is a new deployment, and because the folder name is already taken, Orchestrator createsMySolution 1,MySolution 2, and so on: one folder per run. - Under the client-credentials login this pipeline uses, the CLI's "already deployed" check only warns; it does not stop the run.
- Once the deployment exists,
uip solution deploy upgrade --name "$(DEPLOYMENT_NAME)" --package-name "$(SOLUTION_NAME)" --version <version>does the same upgrade. Unlikedeploy run, it fails when no deployment has that name, instead of creating one. Seedeploy upgrade. - If you add
--config-file, keep only the resources you change in the file. Each resource the file names is applied as written on every run, so a file straight fromdeploy config getsets those resources back to the package defaults.
- The first run creates the deployment and its folder,
condition:on the stage skips Deploy for pull-request builds (Build.ReasonisPullRequest). Without it, every pull request would upgrade the production deployment to unmerged code. To deploy pull requests, give each one its own deployment name in a test tenant: see A copy per pull request.
Stage 3 — Test
Only runs if TEST_SET_KEY is set at the variable-group level — the condition: guard skips the stage cleanly if you don't have a test suite configured.
The shell block is the canonical launch → wait → verify flow from How-to: run tests from the CLI:
uip tm testsets runlaunches the run and returns anExecutionId.uip tm waitblocks until the execution reaches a terminal state. It exits1when a test failed or the run was cancelled, and4on timeout.uip tm report getreadsData.Failed; the step fails with##vso[task.logissue type=error]so the outcome surfaces cleanly in the Azure DevOps UI.
Common variations
Promote across environments
Link two variable groups — uipath-stage and uipath-prod — and turn each into a separate deployment: job. Use environment-specific gates/approvals to decide when prod runs:
- stage: DeployStage
dependsOn: Build
jobs:
- deployment: deploy-stage
variables: [ { group: uipath-stage } ]
environment: 'uipath-stage'
# …same steps as above, but with stage's tenant
- stage: DeployProd
dependsOn: DeployStage
jobs:
- deployment: deploy-prod
variables: [ { group: uipath-prod } ]
environment: 'uipath-prod' # attach a manual approval gate here
# …same steps as above
- stage: DeployStage
dependsOn: Build
jobs:
- deployment: deploy-stage
variables: [ { group: uipath-stage } ]
environment: 'uipath-stage'
# …same steps as above, but with stage's tenant
- stage: DeployProd
dependsOn: DeployStage
jobs:
- deployment: deploy-prod
variables: [ { group: uipath-prod } ]
environment: 'uipath-prod' # attach a manual approval gate here
# …same steps as above
Deeper coverage in How-to: pack and publish a Solution — promote one package across tenants.
Rollback
Azure DevOps does not roll back automatically; add a manual stage that upgrades the existing deployment back to the previous version. It uses deploy upgrade --name rather than deploy run: deploy upgrade never creates a deployment, so a mistyped name fails instead of installing a fresh copy in a new folder:
- stage: Rollback
dependsOn: [] # run on demand, not from Deploy
condition: ne(variables['ROLLBACK_VERSION'], '')
jobs:
- job: rollback
pool: { vmImage: 'ubuntu-latest' }
steps:
# …install + auth…
- script: |
set -euo pipefail
uip solution deploy upgrade \
--name "$(DEPLOYMENT_NAME)" \
--package-name "$(SOLUTION_NAME)" \
--version "$(ROLLBACK_VERSION)"
displayName: 'Roll back to previous version'
- stage: Rollback
dependsOn: [] # run on demand, not from Deploy
condition: ne(variables['ROLLBACK_VERSION'], '')
jobs:
- job: rollback
pool: { vmImage: 'ubuntu-latest' }
steps:
# …install + auth…
- script: |
set -euo pipefail
uip solution deploy upgrade \
--name "$(DEPLOYMENT_NAME)" \
--package-name "$(SOLUTION_NAME)" \
--version "$(ROLLBACK_VERSION)"
displayName: 'Roll back to previous version'
Pass ROLLBACK_VERSION at queue time. deploy upgrade preserves the deployment's existing configuration (asset/credential values already set on it aren't reset to package defaults), and it accepts any published version of the package, including an older one. Add eq(variables['ROLLBACK_VERSION'], '') to the Deploy stage's condition: as well, so a rollback run does not also deploy the new build to the same deployment. For destructive rollback (uninstall + delete artifact), see How-to: pack and publish a Solution — rollback.
A copy per pull request
To review a pull request on a running copy, deploy it under a name and folder of its own in a test tenant. The name stays the same for the life of the pull request: its first build creates the copy, and every later push updates that copy in place.
- stage: DeployPR
displayName: "Deploy this pull request's copy"
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'), ne(variables['System.PullRequest.IsFork'], 'True'))
jobs:
- deployment: deploy_pr
variables: [ { group: uipath-pr-preview } ] # UIPATH_CLIENT_ID, UIPATH_CLIENT_SECRET, UIPATH_TENANT of a test tenant
environment: 'uipath-pr-preview'
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
# …same checkout, install, authenticate, download and publish steps as Deploy…
- script: |
set -euo pipefail
uip solution deploy run \
--name "$(DEPLOYMENT_NAME)-pr-$(System.PullRequest.PullRequestId)" \
--package-name "$(SOLUTION_NAME)" \
--package-version "$(SOLUTION_VERSION)" \
--folder-name "MySolution-pr-$(System.PullRequest.PullRequestId)" \
--parent-folder-path Shared \
--yes
displayName: 'Deploy to Orchestrator'
- stage: DeployPR
displayName: "Deploy this pull request's copy"
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'), ne(variables['System.PullRequest.IsFork'], 'True'))
jobs:
- deployment: deploy_pr
variables: [ { group: uipath-pr-preview } ] # UIPATH_CLIENT_ID, UIPATH_CLIENT_SECRET, UIPATH_TENANT of a test tenant
environment: 'uipath-pr-preview'
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
# …same checkout, install, authenticate, download and publish steps as Deploy…
- script: |
set -euo pipefail
uip solution deploy run \
--name "$(DEPLOYMENT_NAME)-pr-$(System.PullRequest.PullRequestId)" \
--package-name "$(SOLUTION_NAME)" \
--package-version "$(SOLUTION_VERSION)" \
--folder-name "MySolution-pr-$(System.PullRequest.PullRequestId)" \
--parent-folder-path Shared \
--yes
displayName: 'Deploy to Orchestrator'
- The pull request ID in
--nameand--folder-namegives each pull request its own deployment and its own folder, for exampleShared/MySolution-pr-42. On a GitHub repository, useSystem.PullRequest.PullRequestNumberinstead, to get the number GitHub shows.--yesskips the "already deployed" check, since the test tenant is expected to hold other pull requests' copies of the package. variables: [ { group: uipath-pr-preview } ]holds the test tenant'sUIPATH_CLIENT_ID,UIPATH_CLIENT_SECRETandUIPATH_TENANT. Job variables take precedence over the pipeline'suipath-prodgroup, so the copied steps log in to the test tenant unchanged. Never point this group at the production tenant.System.PullRequest.IsForkskips pull requests from forks, so code from outside the repository never runs with the test tenant's credentials.
Skipping tests
To run without the test stage, delete the Test stage block (or leave TEST_SET_KEY unset — the condition: on the stage will skip it).
Common pitfalls
env.prefix vs literal secret. Always--client-secret env.UIPATH_CLIENT_SECRET, never--client-secret "$(UIPATH_CLIENT_SECRET)". The literal form embeds the value into the rendered command line. See the auth warning.##vso[task.setvariable]is not needed forenv.resolution —env:on the step exposes the variable directly.- Multi-line bash needs
set -euo pipefailat the top of everyscript:block. Without it,packcan fail while later steps keep running. See Scripting patterns — strict shell options. - Cache hits are not guaranteed. Always wrap the
npm installinif ! command -v uipso the pipeline self-heals when the cache is cold.uip updateruns outside the guard, on every job.
See also
- How-to: deploy to Orchestrator from CI — platform-agnostic guidance.
- How-to: pack and publish a Solution — versioning and rollback.
- How-to: run tests from the CLI — the launch → wait → verify pattern in depth.
- CI/CD recipe: GitHub Actions, Jenkins, GitLab CI — the same pipeline in other platforms.