Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 12 of 30
❮Prev Next❯

Copilot Code Review on Pull Requests

Module 2: Copilot Features ⏱ 9 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Copilot code review reads a pull request and leaves review comments, often with a suggested change you can commit in one click. You add Copilot under Reviewers (or ask for a review in your IDE), or a ruleset requests it automatically on new pull requests. Its review is always a Comment: it never approves or requests changes and doesn't count toward required approvals, so a person still approves and merges. It follows your team's standards from .github/copilot-instructions.md and path-specific .instructions.md files, and it's part of the paid Copilot plans.

    Simulate it » No Azure account needed

    Exam objective: 2.3.2 Use Copilot for code review and coding assistance. 2.3.3 Use Spaces, Spark, Pull Request summaries, and customizable review standards via instructions files. (Skills measured as of August 7, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    VS Code & GitHub: Ask Copilot to review a pull request Request a Copilot review and commit its suggestion.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading…

    Open the pull request and, under <strong>Reviewers</strong>, pick <strong>Copilot</strong>. You can also ask for a review from VS Code, or set a <strong>ruleset</strong> so Copilot reviews every new PR automatically.

    👆 Click the glowing item on screen to continue

    Read the steps as text
    1. Open the pull request and, under Reviewers, pick Copilot. You can also ask for a review from VS Code, or set a ruleset so Copilot reviews every new PR automatically.
    2. Copilot leaves comments, often with a suggested change you can commit in one click. Its review is always a Comment: it never approves or blocks the merge.
    3. Put your team’s review standards in the instructions file. Copilot code review reads .github/copilot-instructions.md (and path-specific .instructions.md files) when it reviews.
    4. Admins switch Copilot code review on in the Copilot policies, and can require it with a repository or organization ruleset.

    🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.

    😟 THE PROBLEM

    Pull requests wait two days for a first look.

    😊 THE SOLUTION

    Ask Copilot for a first review and let people focus on design.

    • Slow first feedback✓ Copilot as a reviewer
    • Inconsistent standards✓ Review rules in instructions
    • Reviews forgotten✓ Automatic review by ruleset
    🛠️ Solved with: Copilot code review

    Start with a question

    My pull request waits two days for a reviewer, and then they only spot a typo and a missing null check. Can something catch that sooner?

    You open pull request #52 on contoso-shop: a new FREE discount code. The senior developer is busy. When she finally looks, her first three comments are things any careful reader would have caught: free and FREE behave differently, an unknown code returns NaN, there’s no test for the new branch.

    Copilot code review reads the same diff in a few minutes and leaves those comments, often with a fix you can commit. The senior developer still reviews, but now she’s looking at the design, not the typos. And she’s still the one who approves.

    Explain it like I’m 10

    The technical explanation

    Three ways to get a Copilot review

    WhereHowGood for
    On a pull requestOpen the PR, go to Reviewers, pick CopilotA review on demand. Request it again after you push fixes.
    AutomaticallyA repository or organization ruleset with the rule that requests a Copilot reviewEvery new pull request gets reviewed, nobody has to remember
    In the IDEAsk Copilot to review your selection or your changes in VS Code (and other supported editors)Catching problems before you even push

    What the review looks like

    Copilot reads the changed files and posts a review such as “Copilot reviewed 2 files and left 1 comment”. Each comment points to a line and usually explains the problem in a sentence. Many include a suggested change:

    // suggested change on src/discount.js, line 4
    const pct = CODES[String(code).toUpperCase()] ?? 0;

    The author can Commit suggestion from the comment, or reply and Resolve conversation if it doesn’t fit.

    What it doesn’t do

    This is the part the exam loves:

    • It always submits a Comment review. It never Approves and never Requests changes.
    • Its review doesn’t count toward required approvals. A branch that needs one approval still needs one human approval.
    • It doesn’t merge. A person does, and branch protections and status checks still apply.
    • It can miss problems and can be wrong. Treat each comment like a colleague’s suggestion: read it, then decide.

    Review standards from your instructions

    Copilot code review reads the same instruction files as Chat. Put your team’s review rules in .github/copilot-instructions.md:

    ## Code review
    - Flag any discount logic without a unit test.
    - Prefer early returns over nested ifs.
    - Comment in English, be brief.

    Rules for one part of the codebase go in a path-specific .instructions.md file with applyTo, and Copilot code review uses those for matching files too.

    Turning it on

    Copilot code review is part of the paid plans. In an organization, an admin controls it under Organization settings › Copilot › Policies, and can add a ruleset so it runs on new pull requests. If an enterprise enforces the policy, the organization can’t change it.

    1. 1 Open PR

      You open #52, or a ruleset requests Copilot automatically.

    2. 2 Copilot reviews

      It reads the diff and your instruction files.

    3. 3 Comments

      A Comment review with suggested changes.

    4. 4 You decide

      Commit, reply or resolve each comment, then push.

    5. 5 Human approves

      A required human approval and passing checks, then merge.

    A pull request with Copilot code review
    Architect level Copilot reviewing Copilot

    When Copilot coding agent opens a draft pull request, you can ask Copilot code review to look at it too. That’s fine as a first pass, but it’s the same family of models checking its own kind of output, so it shares blind spots. Keep at least one human approval required, keep tests and code scanning as status checks, and make sure whoever assigned the issue to the agent isn’t the only one approving its pull request.

    Real-world business scenario

    Online retail

    Contoso (fictional)

    The problem
    Pull requests on contoso-shop waited a day or more for a first review, and most first comments were about missing tests and unhandled inputs.
    What they used
    An organization ruleset that requests a Copilot code review on every new pull request, plus review rules in .github/copilot-instructions.md. Branch rules still require one human approval and passing tests.
    Why that choice
    Copilot comments within minutes, authors fix the easy issues before a person looks, and Copilot's review can't approve, so the human gate stays.
    The result
    Human reviewers see cleaner pull requests and spend their comments on design and business rules.

    When to use it and when not to

    ✓ Use it when…

    • Fast first feedback on every pull request, before a human reviewer is free.
    • Checking your own changes in the IDE before you push.
    • Teams with written standards that can go into the instructions file.

    ✕ Think twice when…

    • As a replacement for required human approvals. It can never approve.
    • As your only security check. Keep code scanning, secret scanning and tests.
    • Accepting suggested changes without reading them or running the tests.

    ↔ Alternatives to consider

    • Code scanning and linters as status checks for rules that must block a merge.
    • Copilot Chat with /explain or /fix when you want to discuss one change interactively.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A repository has a branch rule that requires one approving review before a pull request can be merged. A developer requests a review from Copilot, and Copilot completes its review. What is the result?

    Question 2

    Question 2 of 5

    An organization wants Copilot to review every new pull request in its repositories without developers having to request the review manually. What should an administrator configure?

    Question 3

    Question 3 of 5

    A team wants Copilot code review to flag any change to discount logic that does not include a unit test. What should the team do?

    Question 4

    Question 4 of 5 · Select 2

    Which TWO actions can a pull request author take on a Copilot code review comment that contains a suggested change?

    Question 5

    Question 5 of 5

    A developer wants Copilot to point out problems in local changes before pushing them to GitHub. What should the developer use?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Can Copilot approve my pull request so I can merge faster?

    Model answer

    No. Copilot code review only leaves Comment reviews. It never approves and never requests changes, and it doesn't count toward required approvals. It's an extra pair of eyes before a human reviewer, not a replacement.

    Interviewer follows up

    Then why use it?

    You

    It catches the obvious things fast, like an unhandled null or a missing test, so the human reviewer can spend their time on design and business logic.

    Intermediate How do you make Copilot review every new pull request without anyone remembering to ask?

    Model answer

    Set up a ruleset on the repository or the organization with the rule that requests an automatic Copilot review. Then every new pull request on the targeted branches gets one.

    Experienced developer Your team wants Copilot's review comments to follow its own standards. How?

    Model answer

    Write them into .github/copilot-instructions.md, for example "flag discount logic without a unit test" or "prefer early returns". For rules that only apply to part of the code, I'd use an .instructions.md file with applyTo. Copilot code review reads both.

    Interviewer follows up

    Does that make the review deterministic?

    You

    No. Two reviews of the same change can comment differently, and it can miss things. That's why it's comments, not a gate, and why we keep tests and code scanning in the pipeline.

    Scenario Copilot left a suggested change on line 4 of discount.js. What do you do with it?

    Model answer

    Read it first. If it's right, I commit the suggestion from the comment, then let the tests run. If it's wrong or doesn't fit, I reply or resolve the conversation. The author owns the code either way.

    Architecture & design Where does Copilot code review fit in a secure delivery pipeline?

    Model answer

    Early, as fast feedback on every pull request. Behind it I still want required human approvals, status checks for tests and code scanning, and branch protections. Copilot reduces the noise humans see, but the gates that block a merge stay human and automated, not AI opinion.

    Quick revision

    Key points

    • Request Copilot under Reviewers on a pull request, or ask for a review from the IDE.
    • A ruleset can request a Copilot review on every new pull request automatically.
    • Copilot leaves Comment reviews with suggested changes you can commit.
    • It never approves or requests changes and doesn't count toward required approvals.
    • It reads .github/copilot-instructions.md and .instructions.md files for review standards.
    • Admins enable Copilot code review through Copilot policies. It's a paid-plan feature.

    Important terminology

    Copilot code review
    A Copilot feature that reviews a pull request or your local changes and leaves comments with suggested fixes.
    Suggested change
    A code block in a review comment that the pull request author can commit straight from the comment.
    Comment review
    A review that gives feedback without approving or requesting changes. Copilot's reviews are always this type.
    Ruleset
    A set of repository or organization rules for branches. One rule can request a Copilot review on new pull requests automatically.
    Required approvals
    A branch protection or ruleset setting that blocks merging until enough human reviewers approve. Copilot's review never counts.

    Common mistakes

    • Expecting Copilot's review to satisfy a "1 required approval" branch rule.
    • Committing every suggestion without reading it or running the tests.
    • Writing review standards in a wiki instead of the instructions file Copilot reads.

    Exam tips

    • "Review every new PR automatically" = a ruleset that requests a Copilot review.
    • "Does Copilot's review satisfy required approvals?" = No, it only leaves Comment reviews.
    • "Make reviews follow team standards" = .github/copilot-instructions.md.

    Five quick revision questions

    1. 1.Which review type does Copilot leave?Show

      Comment. Never Approve or Request changes.

    2. 2.Does a Copilot review count toward required approvals?Show

      No.

    3. 3.How do you get automatic Copilot reviews on new pull requests?Show

      With a ruleset rule that requests a Copilot review.

    4. 4.Which file sets review standards for Copilot code review?Show

      .github/copilot-instructions.md, plus path-specific .instructions.md files.

    5. 5.What can you do with a suggested change in a Copilot comment?Show

      Commit it straight from the comment, after reviewing it.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Copilot Spaces, Spark and Pull Request Summaries

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.