Azure DevOps Repository Integration

With Azure DevOps repository integration, users can now use Azure DevOps Repos as a Git source code repository to complete a build, scan or deployment independent of an Azure DevOps pipeline. This workflow requires setup in Tool Registry - In an Azure DevOps tool, a Jenkins tool, and finally, configuration within Opsera Pipelines. Use the following instructions to properly configure your tools and pipelines.

 

Creating an Azure DevOps Tool in Opsera

  1. Login to the Opsera portal.

  2. Navigate to Tool Registry

  3. Click the ‘+ New Tool’ button.

  4. In the Create New Tool form, enter a Tool Name, select Azure DevOps as the Tool Identifier and fill out any other additional fields.

Configuring your Azure DevOps Tool

Create a personal access token in the Azure DevOps portal

  1. In your Azure DevOps portal, select the User Settings icon, located on the upper right hand side of the screen.

  2. Select Personal access tokens from the dropdown.

  3. Fill out the required fields and make sure to select “Full access” in Scopes.

  4. Copy the personal access token provided in the next step. Warning:  It is not stored and you will not be able to see it again.

Configure your tool using Opsera’s Tool Registry

  1. In the Opsera portal under Tool Registry, open your Azure DevOps tool.

  2. Navigate to the Connections tab.

  3. Provide values for the following fields:

    Personal Access Token - Paste the Personal Access Token retrieved in the instructions above.
    Organization - Provide the DevOps organization set by the user in the azure DevOps portal. It must match the name used in the portal exactly.

     

  4. Click the ‘Save’ button to save your configured tool.

Configuring your Jenkins Tool Accounts to use Azure DevOps Repo

  1. In the Tool Registry, navigate to a configured Jenkins tool.

  2. Navigate to the Accounts tab.

  3. Click the ‘+ New Jenkins Account Credential’ button

     

  4. In the ‘Create New Jenkins Account Credential’ form, provide the following selections to correctly configure your Azure DevOps tool.


    Platform - Select ‘Azure DevOps’ from the dropdown.
    Tool - Select your configured Azure DevOps tool from the dropdown.
    Credential Name - Provide a credential name, this will be the name to select from the ‘Account' dropdown in the pipeline configuration
    Credential Description - Provide a description for the Azure DevOps account credential.

  5. Click the ‘Create’ button

In Opsera Pipelines, you can now configure Jenkins jobs or SonarQube code scans with Azure repositories within the connected Azure DevOps account.

Azure DevOps Repository Integration in Pipelines

With the configurations above, you can now access Azure repositories from the SonarQube pipeline step or Jenkins pipeline step using Maven, Docker, or Gradle Build Job.

SonarQube Tool Pipeline Step

A prerequisite to setting up the SonarQube step utilizing Azure Repository is having a properly configured Jenkins tool with a ‘Code Scan’ Job and ‘Azure DevOps’ Account. Once the Tool selected in Step Setup is ‘SonarQube’, make the following selections in the Step Configuration and save:

  • Jenkins Tool - Select the configured Jenkins tool containing the Code Scan Job and Azure DevOps Account.

  • Job Type - Select ‘Opsera Managed Job’ from the dropdown.

  • Job - Select the ‘Code Scan’ job added in the Jenkins ‘Jobs’ tab.

  • Account - Select the ‘Azure DevOps’ Account that was added to the Jenkins ‘Accounts’ tab.

  • Repository - Select a repository, fetched from the selected Azure DevOps account.

  • Branch - Select a branch.

 

Jenkins Tool Pipeline Step

In pipeline workflow, once Tool selected is ‘Jenkins’ in Step Setup, make the following selections in the Step Configuration and save:

  • Jenkins Tool - Select the configured Jenkins tool containing a Job and Azure DevOps Account.

  • Jenkins Job Type - Select ‘Opsera Managed Job’ or ‘Salesforce Package Generation Job’ from the dropdown.

  • Tool Job - Select a Job added in the Jenkins ‘Jobs’ tab.

  • Account - Select the ‘Azure DevOps’ account that was added to the Jenkins ‘Accounts’ tab.

  • Repository - Select a repository, fetched from the selected Azure DevOps account.

  • Branch - Select a branch.

Once your pipeline step is correctly configured, you can proceed to run the pipeline to use the Azure DevOps Repos as a Git source code repository to complete a build, scan or deployment.