Azure DevOps Setup
This guide will help you set up Codity with Azure DevOps to start reviewing pull requests automatically.
Prerequisites
- An Azure DevOps account with access to the repositories you want to connect
- Important: You must use an organizational account (work or school account). Personal Microsoft accounts (MSA) are NOT supported
- Ability to create Personal Access Tokens (PATs) in Azure DevOps
- Repositories must allow webhook creation
Setup Steps
Step 1: Sign In with Azure DevOps OAuth
- Navigate to Codity Settings → Providers → Azure DevOps
- Click "Connect Azure DevOps"
- You'll be redirected to Azure DevOps to authorize Codity
- Important: Sign in with your organizational account (work or school account), not a personal Microsoft account
- Grant Codity the requested permissions
- You'll be redirected back to Codity
Step 2: Create a Personal Access Token
- Go to Azure DevOps → User Settings → Personal Access Tokens (or visit
https://dev.azure.com/{your-organization}/_usersSettings/tokens) - Click "New Token"
- Configure the token:
- Name: "Codity Access" (or any descriptive name)
- Organization: Select your Azure DevOps organization
- Expiration: Set to 90 days (recommended) or your preferred duration
- Scopes: Select the following required scopes:
Code (Read & Write)- Read repository contents and create branchesPull Requests (Read & Write)- Read PRs, create PRs, and post commentsProject and Team (Read)- Access project and team informationUser Profile (Read)- Read user information
- Click "Create"
- Copy the token immediately - you won't be able to see it again
Step 3: Configure Token in Codity
- Return to Codity Settings → Providers → Azure DevOps
- Paste your Personal Access Token into the "Azure DevOps Token" field
- If using Azure DevOps Server (on-premises), enter your Azure DevOps Server URL
- Click "Save" to store the token
Step 4: Enable Repositories
- Navigate to Repositories → Add Repository
- Select Azure DevOps as your provider
- Choose your organization and project
- Select the repositories you want to enable for code reviews
- Click "Enable" for each repository
Step 5: Verify Setup
- Create a test pull request in one of your connected repositories
- Wait 1-3 minutes for Codity to analyze the PR
- Check the PR comments to see Codity's review feedback
Azure DevOps Server (On-Premises) Setup
If you're using Azure DevOps Server (on-premises):
- Configure Server URL: In Codity Settings → Azure DevOps, enter your Azure DevOps Server URL:
- Format:
https://your-server.com/{collection} - Example:
https://tfs.company.com/DefaultCollection
- Format:
- Network Requirements: Ensure your Azure DevOps Server is accessible from the internet (or from Codity's servers if using a private network)
- SSL Certificate: Your server must have a valid SSL certificate
- Same Features: Azure DevOps Server supports the same features as Azure DevOps Services
Issue: "MSA Not Supported" or "Personal Account Error"
Symptoms:
- Error message about personal Microsoft accounts not being supported
- Cannot sign in with personal Microsoft account
Solutions:
- Use organizational account: You must use a work or school account (organizational account), not a personal Microsoft account
- Check account type: Verify you're signing in with an account that has an organizational email (e.g.,
user@company.comnotuser@outlook.com) - Contact admin: If you don't have an organizational account, contact your organization's IT admin to create one
- Switch accounts: If you're already signed in with a personal account, sign out and sign in with your organizational account
Best Practices
- Use organizational accounts: Always use work or school accounts, never personal Microsoft accounts
- Set appropriate token expiration: Use 90-day expiration for balance of security and convenience
- Rotate tokens proactively: Update tokens 1-2 weeks before expiration to avoid downtime
- Use descriptive token names: Name tokens clearly with organization and expiration date (e.g., "Codity - Contoso - Expires 2024-03-15")
- Monitor token usage: Periodically review active tokens in Azure DevOps and revoke unused ones
- Document token expiration dates: Keep track of when tokens expire to plan rotations
- Test after token updates: After updating a token, create a test PR to verify everything works
- Organization-level tokens: Consider using organization-level tokens when managing multiple projects
- Separate tokens for multiple organizations: If you have multiple organizations, use separate tokens for better security and management
Next Steps
- Learn about GitHub setup
- Learn about GitLab setup
- Learn about Bitbucket setup
- Learn about JIRA Integration for connecting JIRA tickets to PR reviews
- Check the Getting Started Guide for general setup instructions