Safeguard Docs
Enterprise Software Supply Chain Manager (ESSCM)IntegrationsSource Code (SCM)

Azure Repos

Connect Azure DevOps Repos to generate SBOMs from your source code

Permissions and token types

The Azure DevOps integration guide lists the exact permissions each token needs, which token types work, and the current setup steps. Where this page and that guide differ, follow the guide.

Azure Repos Integration

Connect your Azure DevOps Repos to Safeguard for automated SBOM generation and continuous security scanning.

Overview

Azure Repos integration supports:

  • Public and private repositories
  • Azure DevOps Services (dev.azure.com); Azure DevOps Server is not supported
  • Git repositories
  • Multiple organizations and projects

Prerequisites

  • Azure DevOps account with repository access
  • Personal Access Token (PAT) with appropriate permissions
  • Safeguard account with ESSCM access

Creating a Personal Access Token

Step 1: Access Token Settings

  1. Sign in to Azure DevOps
  2. Click your profile icon in the top right
  3. Select Personal access tokens
  4. Click + New Token

Step 2: Configure Token

SettingValue
NameSafeguard Integration
OrganizationSelect your organization (or All accessible organizations)
ExpirationSet appropriate expiration (max 1 year)
ScopesCustom defined

Step 3: Set Permissions

Select these scopes:

ScopePermissionPurpose
CodeReadAccess repository contents
Project and TeamReadList projects and repos
GraphReadAccess user/team info

Click Create and copy the token immediately (it won't be shown again).

Configuring in Safeguard

Public Repositories

  1. Navigate to Integrations page
  2. Click Connect on the Azure Repos card
  3. Select the Public tab
  4. Enter configuration details:
FieldDescription
NameConfiguration name (e.g., "Azure Public Repos")
DescriptionOptional description
Repository URLFull URL (e.g., https://dev.azure.com/org/project/_git/repo)
  1. Click Add to add the repository
  2. Click Next to proceed
  3. Configure project settings and click Connect

Private Repositories

  1. Navigate to Integrations page
  2. Click Connect on the Azure Repos card
  3. Select the Private tab
  4. Enter credentials:
FieldDescription
NameConfiguration name
DescriptionOptional description
Organization URLYour Azure DevOps URL (e.g., https://dev.azure.com/myorg)
Personal Access TokenThe PAT you created
  1. Click Verify Credentials
  2. Once verified, click Next
  3. Select the projects and repositories to scan
  4. Configure branch/tag settings
  5. Click Connect

Repository URL Formats

TypeFormat
Azure DevOps Serviceshttps://dev.azure.com/{org}/{project}/_git/{repo}
SSHgit@ssh.dev.azure.com:v3/{org}/{project}/{repo}

Branch and Tag Selection

When configuring repositories, you can specify:

  • Default branch - Usually main or master
  • Specific branches - Feature branches, release branches
  • Tags - Version tags like v1.0.0
  • All branches - Scan all branches (increases scan time)

Build Pipeline Integration

Integrate with Azure Pipelines for automated scanning:

# azure-pipelines.yml
trigger:
  - main
  - release/*

pool:
  vmImage: 'ubuntu-latest'

steps:
  # safeguard setup downloads the scanner tools that safeguard scan uses.
  - script: |
      curl -fsSL https://registry.safeguard.sh/cli/safeguard/install | bash
      safeguard setup
      safeguard scan --dir . --output safeguard-results
    displayName: 'Security Scan'

  - task: PublishBuildArtifacts@1
    inputs:
      pathToPublish: './safeguard-results'
      artifactName: 'safeguard-results'
    displayName: 'Publish scan results'

Troubleshooting

"TF401019: The Git repository does not exist"

  • Verify the repository URL is correct
  • Check PAT has Code Read permission
  • Ensure you have access to the repository

"TF400813: The user is not authorized"

  • Verify PAT is not expired
  • Check PAT has required scopes
  • Ensure PAT is for the correct organization

"Unable to connect to server"

  • Check firewall rules
  • Verify SSL certificate is valid

Next Steps

On this page