Azure DevOps
Connect MergeGuide to Azure DevOps to run compliance checks on every pull request. Violations appear as PR comments, and PR completion can be blocked until the MergeGuide check passes.Supported Features
- Pull request policy gate (block on violation)
- Inline diff comments on violations
- Build status reporting
- Azure Pipelines task integration
- Organization-level and project-level configuration
Service Connection Setup
Create a personal access token (PAT)
In Azure DevOps, click your profile icon and go to Personal access tokens > New Token.
- Name: MergeGuide
- Organization: Select your organization
- Expiration: Set per your security policy (maximum 1 year)
- Scopes (custom defined):
- Code: Read
- Pull Request Threads: Read & write
- Build: Read & execute
- Service Connections: Read & query
Connect in MergeGuide
Go to Settings > Integrations > Azure DevOps > Connect.Enter:
- Organization URL:
https://dev.azure.com/{your-organization} - Personal Access Token: the token you just created
Webhook Configuration
MergeGuide registers service hooks automatically during setup. To register manually:- In Azure DevOps, go to Project settings > Service hooks > Create subscription
- Select Web Hooks as the service
- Configure for each event type:
| Event | Trigger |
|---|---|
| Pull request created | Set filters as needed |
| Pull request updated | Set filters as needed |
| Code pushed | Set filters as needed |
- Set the webhook URL to
https://portal.mergeguide.ai/webhooks/azure-devops - Add the shared secret from Settings > Integrations > Azure DevOps > Webhook Secret in MergeGuide
Pull Request Policy Gate
Advisory Mode (Comments Only)
MergeGuide posts a comment thread on every PR with violation details. No blocking.Blocking Mode
Use Azure DevOps branch policies to require the MergeGuide status check before merging:Go to branch policies
In Azure DevOps, go to Project settings > Repos > Policies, then select your repository and main branch.
Add a status check
Under Additional settings, click + Add status policy.
- Status to check:
mergeguide/compliance - Policy requirement: Required
- Reset conditions: Reset when new code is pushed
Azure Pipelines Task
Add MergeGuide to your pipeline using the Pipelines task:MERGEGUIDE_API_KEY and MERGEGUIDE_ORG_ID as pipeline variables or in a variable group under Library. Mark them secret to prevent exposure in logs.
Fail the Pipeline on Violations
--fail-on values: never, warning, error
Organization vs. Project Level
Organization-Level Setup
Connect at the organization level to manage settings for all projects from one place. Requires an organization owner PAT.- Go to Settings > Integrations > Azure DevOps > Connect
- Enter your organization URL:
https://dev.azure.com/{organization} - Select Organization level — MergeGuide discovers all projects automatically
Project-Level Setup
Connect at the project level when you need separate configurations per project, or when organization-level access is not available. Enter the project URL:https://dev.azure.com/{organization}/{project}
Inline Comments
MergeGuide posts violation comments on the relevant PR diff lines:Troubleshooting
”TF401019” or unauthorized errors
The PAT does not have the required scopes. Create a new PAT with Code (Read) and Pull Request Threads (Read & write) scopes.Status check not appearing on PR
- Verify the repository is enabled under Settings > Integrations > Azure DevOps
- Confirm service hooks are registered in Project settings > Service hooks
- Check the service hook delivery log for errors