Azure Pipelines for Customer Projects

This guide is intended for partners and customers who want to use their own Azure DevOps as their Git repository and CI/CD tool instead of GitLab.

Make sure you have sufficient rights in Azure.

  1. Navigate to Pipelines > Create New Pipeline.

  2. Select the source Git repository. Most probably this will be “Azure repos Git”.

  3. Select the right Git repository.

  4. Select Starter Pipeline and replace the existing editor content with the following:

       trigger:
    - qa
    - uat
    
    stages:
    - stage: Deploy
      jobs:
      - job: Deploy_QA
        condition: eq(variables['Build.SourceBranchName'], 'qa')
        container: pricefx/pfxpackage:latest
        steps:
        - script: pfxpackage -import -timeout 120 -url ${URL} -user ${PFX_USER} -password $(PFX_PASS) -partition ${PARTITION} -from . ${OPTIONS}
          displayName: 'Deploy QA'
          env:
            PARTITION: partition-qa
            URL: https://qa.pricefx.eu
    
      - job: Deploy_PROD
        condition: eq(variables['Build.SourceBranchName'], 'master')
        container: pricefx/pfxpackage:latest
        steps:
          - script: pfxpackage -import -timeout 120 -url ${URL} -user ${PFX_USER} -password $(PFX_PASS) -partition ${PARTITION} -from . ${OPTIONS}
            displayName: 'Deploy PROD'
            env:
              PARTITION: partition-uat
              URL: https://www.pricefx.eu
    
  5. Click Save. This will create azure-pipelines.yml file in the root directory of your project.

  6. Click Variables and create variables PFX_USER and PFX_PASS:

    • Add the variable PFX_USER and set its value to pfx.deploy and click OK.

    • Add the variable PFX_PASS and set its value to be a strong password (at least 14 characters, at least 1 digit, at least 1 capital letter). Select Keep this value secret and click OK.

  7. Create a user account pfx.deploy in the target partitions (QA, PROD) and assign this user the General Admin privileges in each of the partitions where you want to enable deployment and set the password to be identical to the PFX_PASS variable.

Notes:

  • You should set displayName to correspond to your partition, eg. Deploy QA or Deploy PROD.

  • You must set the PARTITION and URL variables to the right values of your environment.

  • You must set which branch to use for the source under the trigger section.