Azure DevOps Integration

Connect Otto to Azure DevOps to create pull requests and respond to code reviews. Otto uses a service principal (application identity) to access your Azure DevOps organization.

Prerequisites

Before connecting, you need:

  1. An Azure DevOps organization
  2. Admin access to your Azure DevOps organization settings (to add the service principal)
  3. Your Azure AD Tenant ID (found in Azure Portal → Microsoft Entra ID → Overview)

Connecting Azure DevOps

Step 1: Add Otto's Service Principal to Azure DevOps

  1. In Azure DevOps, go to Organization Settings → Users → Add users
  2. Search for Otto's service principal by app name or client ID
  3. Set access level to Basic
  4. Add the service principal to relevant projects as Contributor

Step 2: Connect in Otto

  1. Go to Settings → Integrations in your Otto dashboard
  2. Click Connect on the Azure Repos card
  3. Enter your Azure DevOps organization name (from https://dev.azure.com/your-org-name)
  4. Enter your Azure AD Tenant ID
  5. Click Connect

Otto validates access to your organization and automatically creates webhook subscriptions for PR events.

How Otto Uses Azure DevOps

Creating Branches

When Otto starts work on a work item, it:

  1. Creates a new branch from your default branch
  2. Branch name: otto/[work-item-id]-[slug]
  3. Example: otto/1234-add-user-avatar

Making Commits

Otto commits changes with:

  • Clear commit messages describing the change
  • Linked work items in commit messages
  • Co-authored attribution when responding to feedback

Opening Pull Requests

Otto's PRs include:

  • Descriptive title matching the work item
  • Summary of changes
  • Link to the Jira or Azure DevOps work item
  • Implementation notes
  • Test instructions (if applicable)

Responding to Reviews

When you leave review comments, Otto:

  1. Reads the feedback
  2. Makes the requested changes
  3. Pushes a new commit
  4. Responds to the comment with a summary

The otto/review Status

Whenever Otto starts a fresh review of a pull request, it posts an otto/review status on the PR iteration it is reviewing. A fresh review happens when a PR is created, when new commits are pushed (if your reviewer trigger listens to PR updates), or when someone comments /otto review. Replies to comments don't touch the status.

The status says whether Otto is still reviewing. It never reflects Otto's verdict, which Otto records as its reviewer vote (approve or wait for author):

StateMeaning
PendingOtto is reviewing this iteration.
SucceededOtto finished reviewing (approved, requested changes, or commented).
Not applicableOtto couldn't finish: it errored, timed out (after 60 minutes), the PR was too large, or the org is out of credits.

A required status policy treats "not applicable" as not applying to the PR, so a finished or broken Otto review never blocks completion. Comment /otto review to retry.

Waiting for Otto before completing a PR

To stop PRs from being completed while Otto is reviewing, add a status check policy to the target branch (Branch policies > Status checks > +):

SettingValue
Status to checkotto/review
Policy requirementRequired
Authorized identityOtto's service principal, so only Otto can satisfy the policy
Reset conditionsOptional; see the caveat below
Policy applicabilityApply by default

Caveat: a required status that is never posted blocks completion. Otto only posts it on PRs it reviews, so require it only on branches where Otto reviews every PR. With Reset status whenever there are new changes turned on, every push resets the policy until Otto reviews the new iteration. Only turn it on when your PR reviewer trigger also runs on PR updates; otherwise each push blocks the PR until someone comments /otto review.

Webhook Events

Otto automatically subscribes to these Azure DevOps events:

EventDescription
PR createdNew pull request opened
PR updatedPull request modified
PR commentComment added to pull request

Required Permissions

The Otto service principal needs these permissions in your Azure DevOps organization:

PermissionPurpose
Code (read/write)Read code, create branches, push commits
Pull requests (read/write)Create and update pull requests
Work items (read/write)Link PRs to work items
Identity (read)Access user and team information

Best Practices

Start with a Test Project

Initially, give Otto access to a test repository to validate your configuration before expanding to production repos.

Use Branch Policies

Always require PR reviews and build validation before completing PRs from Otto.

Enable CI/CD Pipelines

Set up automated tests and deployment pipelines that run on Otto's PRs to catch issues early.

Work Item Linking

Ensure work items are properly linked in PRs for traceability and audit purposes.

Team-Specific Agents

If you have multiple teams or products, create separate agents with team-specific context for better results.

Troubleshooting

"Failed to validate access"

The service principal has not been added to your Azure DevOps organization, or it lacks sufficient permissions.

Fix: Go to Azure DevOps → Organization Settings → Users → Add users, search for Otto's service principal, and grant Basic access level.

"Tenant ID not found" or token acquisition error

The Tenant ID may be incorrect.

Fix: In the Azure Portal, navigate to Microsoft Entra ID → Overview and copy the Tenant ID value.

Webhook subscriptions not created

Otto creates webhook subscriptions automatically during connection. If they fail, Otto will still connect but won't receive PR events.

Fix: Disconnect and reconnect the integration, or contact support.