This document describes how to use the Arc XP deploy task in your Azure Pipelines.
Copy the template to your repository and reference it:
mkdir -p .azure
cp azure-templates.yml .azure/deploy-template.ymlThen add to your azure-pipelines.yml:
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
- script: npm ci && npm run build
displayName: 'Install and build'
- stage: Deploy
dependsOn: Build
jobs:
- job: DeployJob
steps:
- template: .azure/deploy-template.yml
parameters:
orgId: $(ARC_XP_ORG_ID)
apiKey: $(ARC_XP_API_KEY)
apiHostname: $(ARC_XP_API_HOSTNAME)
bundlePrefix: 'my-bundle'
artifact: 'dist/fusion-bundle.zip'The template will:
- Download the latest deployment script from GitHub (v2)
- Set up the required environment variables
- Run the deployment
The script accepts inputs via environment variables with the INPUT_ prefix:
- INPUT_ORG_ID - The Arc XP organization ID
- INPUT_API_KEY - The Arc XP API key (use Azure Pipelines secrets)
- INPUT_API_HOSTNAME - The Arc XP API hostname (e.g.,
api.sandbox.org.arcpublishing.com) - INPUT_BUNDLE_PREFIX - The prefix for the bundle name used to identify it in Arc XP UI
- INPUT_PAGEBUILDER_VERSION - The PageBuilder version to deploy with (default:
latest) - INPUT_ARTIFACT - Path to the artifact to upload (default:
dist/fusion-bundle.zip) - INPUT_RETRY_COUNT - Number of retry attempts on failure (default:
10) - INPUT_RETRY_DELAY - Seconds to wait between retries (default:
5) - INPUT_MINIMUM_RUNNING_VERSIONS - Minimum number of versions to keep deployed (default:
7, max:10) - INPUT_TERMINATE_RETRY_COUNT - Times to retry terminating oldest build if it fails (default:
3) - INPUT_TERMINATE_RETRY_DELAY - Seconds between termination retries (default:
10) - INPUT_DEPLOY - Whether to deploy the bundle (default:
true) - INPUT_PROMOTE - Whether to promote the deployed version (default:
true)
-
Go to Pipelines → Library → Variable groups
-
Create a new variable group named
arcxp-secrets -
Add the following variables (mark API key as secret):
ARC_XP_ORG_ID- Your Arc XP organization IDARC_XP_API_KEY- Your Arc XP API key (toggle as secret)ARC_XP_API_HOSTNAME- Your Arc XP API hostname
-
Link the variable group in your pipeline:
variables:
- group: arcxp-secretstrigger:
- main
variables:
- group: arcxp-secrets
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
displayName: 'Build PageBuilder Bundle'
jobs:
- job: BuildJob
displayName: 'Build'
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- script: npm ci
displayName: 'Install dependencies'
- script: npm run build
displayName: 'Build bundle'
- stage: Deploy
displayName: 'Deploy to Arc XP'
dependsOn: Build
condition: succeeded()
jobs:
- job: DeployJob
displayName: 'Deploy'
steps:
- template: .azure/deploy-template.yml
parameters:
orgId: $(ARC_XP_ORG_ID)
apiKey: $(ARC_XP_API_KEY)
apiHostname: $(ARC_XP_API_HOSTNAME)
bundlePrefix: 'my-bundle'
pagebuilderVersion: 'latest'
artifact: 'dist/fusion-bundle.zip'
retryCount: '10'
minimumRunningVersions: '7'The template:
- Downloads the latest deployment script from GitHub (release:
v2) - Exports all parameters as
INPUT_*environment variables - Executes the Node.js script with those environment variables
Deploy to multiple environments by creating separate variable groups:
stages:
- stage: DeployDev
displayName: 'Deploy to Dev'
jobs:
- job: DeployJob
variables:
- group: arcxp-dev-secrets
steps:
- template: .azure/deploy-template.yml
parameters:
orgId: $(ARC_XP_ORG_ID)
apiKey: $(ARC_XP_API_KEY)
apiHostname: $(ARC_XP_API_HOSTNAME)
bundlePrefix: 'my-bundle-dev'
- stage: DeployProd
displayName: 'Deploy to Production'
dependsOn: DeployDev
condition: succeeded()
jobs:
- job: DeployJob
variables:
- group: arcxp-prod-secrets
steps:
- template: .azure/deploy-template.yml
parameters:
orgId: $(ARC_XP_ORG_ID)
apiKey: $(ARC_XP_API_KEY)
apiHostname: $(ARC_XP_API_HOSTNAME)
bundlePrefix: 'my-bundle-prod'If the deployment script fails to download:
- Check that your Azure Pipeline agent has internet access
- Verify the GitHub URL is correct and the branch exists
- Check firewall rules allow access to
raw.githubusercontent.com
- Verify the variable group is linked:
variables: - group: arcxp-secrets - Ensure API key is marked as secret in the variable group
- Check that
orgIdandapiHostnamematch your Arc XP environment
- Verify you're using the correct variable group for the stage
- Check that parameters are using the correct variable names (e.g.,
$(ARC_XP_ORG_ID)not$(DEV_ORG_ID))