Microsoft Azure DevOps Services (UA) Integration

image-20220726-211330.png

Overview

This page provides step-by-step instructions on how to run the Unified Agent from Azure DevOps Services.

NOTE: Before you begin, make sure that the relevant package manager is installed. For details, see Getting Started with the Unified Agent | Prerequisites .

Unified Agent Configuration

The below integration uses environment variables to configure the Unified Agent so that the default configuration values are used.

For more information, see the following articles:

Setting up Your Build Pipeline

  1. Go to Pipelines > Builds >  New > New Build Pipeline.

  2. Select the source for your code. You can create a pipeline using YAML (Option 1), or use the classic editor to create a pipeline without YAML (Option 2).

Option 1: Creating a Pipeline Using YAML

  1. In the Where is your code? screen, select a YAML-enabled option.

    image2019-9-15_16-9-40.png
  2. In the Select a repository screen, select your repository.

    image2019-9-15_15-33-31.png
  3. In Configure your pipeline, select the relevant pipeline configuration.

    image2019-9-15_16-8-43.png
  4. In Review your pipeline YAML, add the following text as a post-build step. This activates the Mend integration on your build pipeline.

    YAML
    - script: |
        curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
        echo Unified Agent downloaded successfully
        java -jar wss-unified-agent.jar
      env:
        WS_APIKEY: $(APIKEY)
        WS_USERKEY: $(USERKEY)
        WS_WSS_URL: $(WSS_URL)
        WS_PRODUCTNAME: AZDO_$(System.TeamProject)
        WS_PROJECTNAME: $(Build.Repository.Name)_$(Build.SourceBranchName)
      displayName: 'Mend Unified Agent Scan'
    
  5. Add environment variables for APIKEY, USERKEY, and WSS_URL, as described by the Microsoft documentation, https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch

  6. Click Save and run.

Option 2: Creating a Pipeline Without YAML (Classic Editor)

  1. Select the type of repository:

    select-repo.png
  2. Select an Empty job:

    image2018-10-23_12-53-37.png
  3. Enter a name for the job and select an Agent pool:

    image2018-10-23_14-56-34.png
  4. Add the relevant build task (Maven, npm, Gradle, .NET Core, etc.).

    build-task.png
  5. Add a Command Line task and update the following fields to activate the Mend integration on your build pipeline.

    • Display name: Mend Unified Agent Scan

    • Script:

      YAML
      curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
      echo Unified Agent downloaded successfully
      java -jar wss-unified-agent.jar
      
    • Environment Variables:

      • WS_APIKEY: your-apiKey

      • WS_USERKEY: your-userKey

      • WS_WSS_URL: your-wssUrl

      • WS_PRODUCTNAME: AZDO_$(System.TeamProject)

      • WS_PROJECTNAME: $(Build.Repository.Name)_$(Build.SourceBranchName)

  6. Click Save & queue.

Unified Agent - CI-CD Scanning | Azure DevOps

This video demonstrates how to configure your AZDO pipeline YAML file to run the Unified Agent.