Overview
The GPT Pull Request Review task for Azure DevOps allows developers to leverage the power of AI in the code review process. By integrating OpenAI's language models, this tool automates the review of pull requests, providing insightful feedback and enhancing collaboration among team members. This guide will walk you through the installation, setup, and usage of this powerful tool to streamline your development workflow.
Table of Contents
- Installation
- Setup
- How to use it
- Referenced Original Project
Installation
Installation can be done using Visual Studio MarketPlace.
Setup
Give permission to the build service agent
- Before use this task, make sure that the build service has permissions to contribute to pull requests in your repository :

Potential Fix: Sometimes, even after granting permission, the build service agent may not have the necessary access. To resolve this, create a permission group and grant the required permissions to that group. Then, inherit permissions through the build service agent to ensure it has the appropriate access.
Allow Task to access the system token
Depending on the type of pipeline you are using, follow one of the two steps below:
Yaml pipelines
- Add a checkout section with persistCredentials set to true.
steps:
- checkout: self
persistCredentials: true
Classic editors
- Enable the option "Allow scripts to access the OAuth token" in the "Agent job" properties :

How to use it
Install the extension
- To use the GPT Pull Request Review Task, first install the extension in your Azure DevOps organization. Click on the "Get it free" button and follow the prompts to install it. You may need to authorize the extension to access your Azure DevOps account.
Add the task to the build pipeline
- After installing the extension, add the task to your build pipeline. Go to your build pipeline, click on the "+" icon to add a new task, and search for "Review PR by GPT". Select it and add it to your pipeline.
Provide Azure Open AI API
- Once you have added the task to your pipeline, configure it. In the task configuration, provide your API key from Azure OpenAI API.
- Create Azure OpenAI Service:
- Obtain Endpoint and API Key:
- Task Configuration:
- In your pipeline, add the task and configure it by providing the Azure API key and the updated endpoint.
Custom Additional Prompts
- You can add a custom additional prompt in tasks for all pull requests. This prompt will complement the system message provided. It is not required.
Individual Custom prompts
- You can set individual custom prompts for specific pull requests by adding a description to the PR. Additionally, you can close the individual pull request prompt directly from the task by entering "false".
Language Support
- The task supports both English and Turkish. Ensure consistency in the prompts according to the chosen language.
Review Pull Requests
- When the build is triggered from a Pull Request, the task will review it. If there is feedback on the changed code, the task will add comments to the Pull Request. If the build is triggered manually, the task will be skipped.
Referenced Original Project
This project refers to the project whose original license is MIT, and adds Azure Open AI, Multi-Language support.
Original Project: