Azure DevOps PR Review
Review Azure DevOps pull requests directly inside Visual Studio Code. Open a pull request from its URL, inspect changed files and review threads next to the code, and draft comments with VS Code's Language Model API, typically powered by your GitHub Copilot Chat subscription.
Azure DevOps gives you the standard pull request building blocks such as comments, threads, and approvals, but it still does not give you a strong built-in AI pull request review workflow inside VS Code. This extension fills that gap: open a pull request, click Run AI Review, go through the suggested review findings and comments, edit what you want to keep, and then publish the final review back to Azure DevOps without leaving the editor.

Why This Extension
Azure DevOps pull request review often pulls you out of the editor and into the browser. This extension keeps the review workflow inside VS Code so you can:
- open a pull request without leaving your workspace
- inspect diffs and discussion threads close to the source
- reply to review threads from inside the editor
- generate draft review comments with AI, then edit them before publishing
- use your existing Github Copilot subscription
Features
- Sign in with VS Code's built-in Microsoft authentication provider
- Connect to an Azure DevOps organization without a personal access token
- Open an Azure DevOps pull request from its URL
- List active pull requests for the current repository
- Browse pull request overview, changed files, and review threads in a dedicated
ADO PR view container
- Open changed files in a diff editor backed by pull request revisions
- Reply to threads, resolve them, or reopen them
- Post summary comments
- Load repo-specific review guidance from
.ado-pr-review.json
- Run AI review for the whole pull request, the current file, or the current selection
- Choose which Copilot model to use for AI review
- Edit AI-generated drafts in a dedicated draft panel before publishing
Requirements
- Visual Studio Code
1.98.0 or newer
- Access to an Azure DevOps organization
- A local workspace that matches the Azure DevOps repository for repository-aware features such as pull request listing and file navigation
- GitHub Copilot Chat installed and enabled if you want AI review features
Quick Start
- Install the extension in VS Code.
- Run
Azure DevOps PR: Set Organization URL.
- Enter your organization URL, for example
https://dev.azure.com/contoso.
- Run
Azure DevOps PR: Connect.
- Sign in with your Microsoft account through VS Code.
- Run
Azure DevOps PR: Open Pull Request.
- Paste a pull request URL such as
https://dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>.
After the pull request loads, the ADO PR activity bar view shows:
Overview for metadata and AI readiness
Pull Requests for active pull requests in the current repository
Files for changed files
Threads for review discussions
Authentication
This extension uses VS Code's built-in Microsoft authentication flow.
You do not need:
- a personal access token
- a custom Entra app registration for each user
After sign-in, the extension validates that the selected Microsoft account can access the configured Azure DevOps organization.
The extension expects an organization URL such as:
https://dev.azure.com/contoso
https://contoso.visualstudio.com
If you go straight to Open Pull Request, the extension can infer the organization from the pull request URL and store it automatically.
AI Review
AI review is optional.
When enabled, the extension uses VS Code's Language Model API to send pull request context to the model you select. In most setups, this means GitHub Copilot Chat.
You can run AI review at three levels:
- entire pull request
- current file
- current selection
The generated comments open as editable drafts before anything is published to Azure DevOps.
AI Review Prerequisites
- GitHub Copilot Chat is installed in the same VS Code environment
- At least one language model is available in VS Code
- The selected model has been approved for use if VS Code requires consent
Model Selection
- Run
Azure DevOps PR: Select AI Model to choose the Copilot model used for AI review
- The extension stores the exact
LanguageModelChat.id in adoPr.review.preferredModelId
- Choose
Automatic to clear that setting and go back to automatic model selection
- If the configured model is unavailable in the current VS Code window, AI review is blocked until you select another model or clear the setting
Example:
{
"adoPr.review.preferredModelId": "copilot:gpt-5.4"
}
The value above is only an example. Use Select AI Model to see the exact model ids available in your VS Code session.
Review Guidance File
The extension can load repository-specific review instructions from .ado-pr-review.json in the workspace root.
Example:
{
"version": 1,
"reviewInstructions": [
"Prioritize correctness, security, and data handling issues.",
"Avoid low-value style comments unless they hide a real risk."
]
}
If the file is missing, Azure DevOps PR: Open Review Config can create a starter config for you.
Commands
Azure DevOps PR: Connect
Azure DevOps PR: Disconnect
Azure DevOps PR: Set Organization URL
Azure DevOps PR: Open Pull Request
Azure DevOps PR: Open Selected Pull Request
Azure DevOps PR: Refresh Pull Request
Azure DevOps PR: Refresh Pull Request List
Azure DevOps PR: Run AI Review
Azure DevOps PR: Select AI Model
Azure DevOps PR: Open Review Config
Azure DevOps PR: Show Draft Suggestions
Azure DevOps PR: Publish Draft Comment
Azure DevOps PR: Reply To Thread
Azure DevOps PR: Resolve Thread
Azure DevOps PR: Reopen Thread
Azure DevOps PR: Post Summary Comment
Azure DevOps PR: Open Changed File
Azure DevOps PR: Open Thread Location
Settings
| Setting |
Description |
adoPr.azureDevOps.organizationUrl |
Azure DevOps organization URL, for example https://dev.azure.com/contoso. |
adoPr.azureDevOps.scopes |
Microsoft authentication scopes requested through VS Code. |
adoPr.azureDevOps.apiVersion |
Azure DevOps REST API version used by the extension. |
adoPr.azureDevOps.baseUrl |
Azure DevOps base URL. |
adoPr.review.maxFilesForAi |
Maximum number of changed files included in a pull request-level AI review. |
adoPr.review.maxDiffChars |
Maximum number of diff characters sent per AI request. |
adoPr.review.preferredModelId |
Preferred language model id for AI review. Leave empty for automatic selection. |
Example:
{
"adoPr.azureDevOps.organizationUrl": "https://dev.azure.com/contoso",
"adoPr.review.maxFilesForAi": 20,
"adoPr.review.maxDiffChars": 18000,
"adoPr.review.preferredModelId": ""
}
Typical Workflow
- Connect to your Azure DevOps organization.
- Open a pull request from its URL.
- Inspect the overview, changed files, and existing review threads.
- Open a changed file in the diff editor.
- Reply to a thread or post a summary comment if needed.
- Run AI review on the pull request, a file, or a selected code region.
- Edit the generated drafts.
- Publish only the comments you want to keep.
Privacy and Data Flow
The extension interacts with two kinds of services:
- Azure DevOps REST APIs to load pull request metadata, diffs, files, and threads, and to publish replies or comments
- VS Code language model providers, such as GitHub Copilot Chat, when you explicitly run AI review
If you use AI review, pull request content such as file paths, diffs, and review instructions may be sent to the selected model provider through VS Code's Language Model API.
If you do not run AI review, the extension does not send pull request code to a language model.
Local Development
Build and Verify
npm install
npm run build
npm test
npm run test:extension
npm run package:vsix
This produces:
dist/vscode-ado-pr-extension.vsix
Install the VSIX
- Open VS Code.
- Open the Extensions view.
- Click
....
- Choose
Install from VSIX....
- Select
dist/vscode-ado-pr-extension.vsix.
Manual Smoke Test
Open a local repository in VS Code that corresponds to the Azure DevOps repository you want to review.
Then run:
Azure DevOps PR: Set Organization URL
Azure DevOps PR: Connect
Azure DevOps PR: Open Pull Request
- Paste a real pull request URL, for example
https://dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>
Expected result:
ADO PR appears in the Activity Bar
Overview shows organization, connected account, title, status, files, and threads
Pull Requests lists active pull requests for the current repository and lets you open one directly
Overview shows AI readiness, including whether a model is available, whether consent is still needed, or whether AI is unavailable
Files lists changed files
Threads lists current review threads
- opening a changed file opens a diff editor
Tests
Run unit and integration tests:
npm test
This covers:
- pull request URL parsing
- organization URL normalization
- repo review config validation
- AI draft parsing
- Azure DevOps client request and response mapping
- thread mutation payloads
- organization access validation
Run extension host tests:
npm run test:extension
This launches a real VS Code test instance and verifies activation plus core command registration. It opens a GUI VS Code process, so it needs a desktop-capable environment.
Packaging
npm run package:vsix
Troubleshooting
Connect fails before sign-in
Check that your organization URL looks like one of these:
https://dev.azure.com/<org>
https://<org>.visualstudio.com
Connect succeeds but Azure DevOps calls return 401 or 403
Usually this means one of:
- the Microsoft account does not have access to the Azure DevOps organization
- the organization URL is wrong
- the requested scopes are not accepted in your environment
- the pull request belongs to a different Azure DevOps organization than the one currently configured
No AI model is available
Make sure GitHub Copilot Chat is installed and enabled in the same VS Code environment. The Overview view reports whether AI is ready, waiting for consent, or unavailable.
The extension uses conservative fallback behavior when exact Azure DevOps diff anchoring is unclear. File-level and summary comments are usually the easiest way to confirm end-to-end behavior in a new environment.
Known Limitations
- One Azure DevOps organization is active per workspace
- One pull request is active at a time
- Large pull requests are truncated in AI review flows to keep request size bounded
- Exact Azure DevOps line anchoring is not guaranteed for all diff shapes
Feedback
If you are testing early versions of the extension, feedback is most useful when it includes:
- the pull request URL pattern you used
- whether the workspace repository matched the Azure DevOps repository
- whether the issue was in authentication, file navigation, threads, or AI review
- whether the failure was reproducible