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
- Sign in to Azure DevOps
- Click your profile icon in the top right
- Select Personal access tokens
- Click + New Token
Step 2: Configure Token
| Setting | Value |
|---|---|
| Name | Safeguard Integration |
| Organization | Select your organization (or All accessible organizations) |
| Expiration | Set appropriate expiration (max 1 year) |
| Scopes | Custom defined |
Step 3: Set Permissions
Select these scopes:
| Scope | Permission | Purpose |
|---|---|---|
| Code | Read | Access repository contents |
| Project and Team | Read | List projects and repos |
| Graph | Read | Access user/team info |
Click Create and copy the token immediately (it won't be shown again).
Configuring in Safeguard
Public Repositories
- Navigate to Integrations page
- Click Connect on the Azure Repos card
- Select the Public tab
- Enter configuration details:
| Field | Description |
|---|---|
| Name | Configuration name (e.g., "Azure Public Repos") |
| Description | Optional description |
| Repository URL | Full URL (e.g., https://dev.azure.com/org/project/_git/repo) |
- Click Add to add the repository
- Click Next to proceed
- Configure project settings and click Connect
Private Repositories
- Navigate to Integrations page
- Click Connect on the Azure Repos card
- Select the Private tab
- Enter credentials:
| Field | Description |
|---|---|
| Name | Configuration name |
| Description | Optional description |
| Organization URL | Your Azure DevOps URL (e.g., https://dev.azure.com/myorg) |
| Personal Access Token | The PAT you created |
- Click Verify Credentials
- Once verified, click Next
- Select the projects and repositories to scan
- Configure branch/tag settings
- Click Connect
Repository URL Formats
| Type | Format |
|---|---|
| Azure DevOps Services | https://dev.azure.com/{org}/{project}/_git/{repo} |
| SSH | git@ssh.dev.azure.com:v3/{org}/{project}/{repo} |
Branch and Tag Selection
When configuring repositories, you can specify:
- Default branch - Usually
mainormaster - 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