Safeguard.sh Documentation Center
Enterprise Software Supply Chain Manager (ESSCM)IntegrationsSource Code (SCM)

Azure Repos

Connect Azure DevOps Repos to generate SBOMs from your source code

Azure Repos Integration

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

Overview

Azure Repos integration supports:

  • Public and private repositories
  • Azure DevOps Services (cloud) and Azure DevOps Server (on-premises)
  • Git repositories
  • Multiple organizations and projects

Prerequisites

  • Azure DevOps account with repository access
  • Personal Access Token (PAT) with appropriate permissions
  • Safeguard.sh 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.sh 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.sh

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

Azure DevOps Server (On-Premises)

For on-premises Azure DevOps Server:

  1. Use your server URL (e.g., https://tfs.company.com/tfs/DefaultCollection)
  2. Ensure the server is accessible from Safeguard.sh (may require VPN or network configuration)
  3. Use the same PAT authentication method

Network Requirements

EndpointPortPurpose
Your Azure DevOps Server443 (HTTPS)Repository access
Safeguard.sh API443SBOM upload

Repository URL Formats

TypeFormat
Azure DevOps Serviceshttps://dev.azure.com/{org}/{project}/_git/{repo}
Azure DevOps Serverhttps://{server}/{collection}/{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:
  - task: NodeTool@0
    inputs:
      versionSpec: '18.x'
    displayName: 'Install Node.js'

  - script: |
      npm install -g @safeguard-sh/cli
      safeguard sbom generate --source . --name "$(Build.Repository.Name)" --version "$(Build.BuildNumber)"
      safeguard gate check --policy production
    env:
      SAFEGUARD_API_KEY: $(SafeguardApiKey)
    displayName: 'Security Scan'

  - task: PublishBuildArtifacts@1
    inputs:
      pathToPublish: './sbom.json'
      artifactName: 'sbom'
    displayName: 'Publish SBOM'

Webhook Configuration

Enable webhooks for automatic scanning on push:

  1. In Azure DevOps, go to Project SettingsService hooks
  2. Click + Create subscription
  3. Select Web Hooks
  4. Configure:
SettingValue
TriggerCode pushed
RepositorySelect your repository
BranchYour target branch
URLhttps://api.safeguard.sh/webhooks/azure-devops
HTTP headersX-Safeguard-Key: YOUR_WEBHOOK_KEY

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"

  • For on-premises: verify network connectivity
  • Check firewall rules
  • Verify SSL certificate is valid

Next Steps

On this page