7 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article details how to create an AI-powered automated code reviewer for Azure DevOps using Microsoft Foundry and Large Language Models. It covers the setup process, necessary scripts, and how to ensure the review outputs are structured for effective automation.
If you do, here's more
Code reviews can often be tedious and time-consuming, especially in environments like Azure DevOps, which lack built-in AI assistance. To tackle this, the author created an automated code reviewer using Large Language Models (LLMs) through Microsoft Foundry. This tool aims to enhance the pull request process by providing structured feedback on code changes. Key requirements include using a cost-effective model, producing structured JSON output, and ensuring that comments are placed directly on relevant lines of code.
The automated review process begins when a developer creates a pull request. This action triggers an Azure Pipeline that retrieves code changes and sends them to the LLM for evaluation. The model then generates feedback in a predefined JSON format, which is essential for further automation. The implementation uses a specific GPT-5 model known for its efficiency and structured output. The article emphasizes the importance of having a clear JSON schema to avoid parsing errors, ensuring reliability in the automation.
To set up the automated reviewer, the author outlines several prerequisites in Azure DevOps, including granting the necessary permissions to a service principal. This principal must have access to the project and repository to post comments on pull requests. Three PowerShell scripts coordinate the process: one identifies code changes, another invokes the LLM for code review, and the last posts the feedback on the pull request. The approach focuses on delivering compact, relevant information for efficient reviews, avoiding the unnecessary complexity of full file content.
Questions about this article
No questions yet.