Azure Repos

Black Duck Polaris Platform

Prerequisites

Creating a personal access token

When integrating Azure repositories with Polaris (whether for on-prem ADO Server or cloud-based ADO Services), you will need a personal token created within the relevant Azure DevOps instance. If you haven't done so already, create this access token before starting the integration process. To assist you during this process, it might be useful to refer to the official Azure documentation: Use personal access tokens > Create a PAT

Important: Token must be created by an Azure DevOps Organization Owner or users with the "Manage organization webhooks" permission, who are authorized to manage organization webhooks. Although other Azure users may be able to select the scope requirements when creating a token, the token will not work due to permission requirements in Azure to manage organization webhooks.
  1. Log in to your ADO instance using your Azure credentials.
  2. Depending on whether you're integrating with a cloud-based or on-prem instance, do one of the following:
    • For ADO Services (cloud) integrations, select User settings > Personal access tokens.
    • For ADO Server (on-prem) integrations, select your user icon in the top-right corner of the page, then select Security.

    You'll now see the User settings page, with the Personal Access Tokens tab selected.

  3. Select +New Token.
  4. Enter a suitable Name for the token.
  5. Under Organization, select All accessible organizations.
  6. Set the token's Expiration date.
  7. For scopes, select Custom defined.
    1. Under Code, select Read & Write.


    2. Under Project and Team, select Read & Write.


  8. Select Create.
  9. From the confirmation dialog, copy and store your token in a secure location such as a password manager.
    Important: Each time you modify a project's SCM integration, you'll need to reenter the token to save your changes.

SCM bulk onboard to create applications and projects

See General Prerequisites before starting.
  1. On the Portfolio page, select + Create > New Application(s) with SCM.
  2. Connect to your SCM:
    1. Select the type of server that is hosting your repository: Cloud-hosted.
    2. Select Azure Repos.
    3. Enter the token created in Azure DevOps (see Prerequisites) under Repository Access Token.
      Note: The access token provided here will be used to complete the onboarding process and will be subject to rate limits enforced by Azure.
    4. Click Connect.

      You should receive a Connection Successful message and the Quick Start options should be visible. If your connection test is unsuccessful, check the following:

      • Your network connection is stable.
      • Check the Repository Access Token to make sure it is accurate.
      • Check that the Repository Access Token is still valid and has not expired.
      • Check that you selected the correct provider for your source repository.
      • Check that you have authorized use of access token outside SSO (if applicable).
  3. Under Quick Start, Select method:
    • Matching Organization Names (Automatic)
    • Mapping Repositories (Custom)
  4. Repository Mapping: This will be different according to which method is selected.
    1. Automatic Mapping: Lists the organization/projects as applications and repositories as projects. You can view repositories to be imported by using the pulldowns (read only).
    2. Custom Mapping: Select New (type application name) or Existing (select application from pulldown), then select repositories from pulldowns under Projects. If an arrow is next to a name, you can click to select repositories within it. Click Add More to map repositories to multiple applications.
    Note:

    In Polaris, names of applications will be Azure Project name (Azure Organization name).

Customizing onboarding (optional)

  1. Assign Application Role: Grant users access to all of the applications and projects you create with an application level role (administrator, contributor, member, observer, or custom roles).
    • The application level roles you select are applied to all of the applications that are being created.
    • Double-check that the user being assigned has access to the repositories in your SCM provider.
  2. Under Integrations: Allows you to sync your SCM provider with Polaris and include non-default branches in your onboarding and sync. After onboarding is complete, you can manage these setting on the application level. See Synchronizing Polaris with your SCM Provider.
    1. Keep repositories and branches synchronized with SCM: Polaris will actively monitor repository updates, deletions, renames, and branch modifications, including updates, deletions, and renames, on the SCM provider. It will then implement the necessary changes to the corresponding Projects and Branches.
      Note: If this is selected without the additional branches option below, this will apply only to default branches.
      Note: Monitoring and updates for renaming is not supported for GitLab.
    2. Continue to import new repositories for above organization. For example, if you create a new repo in GitHub, Polaris will create a new project in Polaris. This is not available when you use custom matching during bulk onboarding.

    3. Import additional branches matching substrings. Default branches are automatically imported but this allows you to import/sync non-default branches.

      1. When selected, a new input field will appear. Enter substrings separated by commas (i.e. -release, -demo)

      2. When selected, a checkbox is available if you want to Continue to import new branches matching substrings after the initial integration. Polaris will monitor for branch creation events on all the repos under the organization/application that match the specified substrings.

  3. Click Import Repositories.
  4. On your Portfolio page, a progress bar with a percentage done will track your progress.

    If the onboarding fails, an email notification will be sent to the user who initiated the onboarding. Organization Admins can monitor activity in audit logs (My Organization > Audit Logs).

    Click Cancel to cancel the import. Any repository in the process of being imported at the time of cancellation will complete in the background after the cancel is accepted. Then all onboarding will be stopped immediately. For example, if you import ten repositories and cancel at 50%, five repositories would be imported and five repositories would not.

  5. You can now set up event-based test automation. See Event-Based Test Automation in Polaris for SCM Integrations.
    Note: To enable Fix Pull Requests for all onboarded applications, create a component policy (see Component policies) and assign it to the applications after onboarding. See SCA Fix Pull Requests.

SCM bulk onboarding projects into an application

See General Prerequisites before starting.
  1. On the Portfolio page, select an application by clicking on its name.
  2. On the Application page, select + Create > New Project(s) with SCM.
  3. Connect to your SCM:
    1. Select the type of server that is hosting your repository: Cloud-hosted.
    2. Select Azure Repos.
    3. Enter the token created in Azure DevOps (see Prerequisites) under Repository Access Token.
      Note: The access token provided here will be used to complete the onboarding process and will be subject to rate limits enforced by Azure.
    4. Click Connect.

      You should receive a Connection Successful message. If your connection test is unsuccessful, check the following:

      • Your network connection is stable.
      • Check the Repository Access Token to make sure it is accurate.
      • Check that the Repository Access Token is still valid and has not expired.
      • Check that you selected the correct provider for your source repository.
      • Check that you have authorized use of access token outside SSO (if applicable).
  4. Repository Mapping: Select repositories to import as new projects from pulldowns. If an arrow is next to a name, you can click to select repositories within it.
  5. Click Import Repositories.

Next Steps