Edit

Assign Code Optimizations insights work items to GitHub Copilot

Get code-level suggestions based on Code Optimizations recommendations with the GitHub Copilot coding agent. In this article, you learn how to:

  • Assign a GitHub issue from Code Optimizations to GitHub Copilot.
  • Iterate with GitHub Copilot through pull request reviews.

Note

Using the GitHub Copilot coding agent requires transferring your data to other countries and regions in which Microsoft operates, including the United States. By using this functionality, you agree to the transfer of your data outside your country or region. Read the Microsoft Privacy Statement.

Prerequisites

Verify Code Optimizations for your application

  1. In the Azure portal, navigate to your Application Insights resource.

  2. Select Investigate > Performance.

  3. In the Performance page, select Code Optimizations in the top menu.

    Screenshot of Code Optimizations located in the Performance page.

Create a GitHub issue

  1. In the Code Optimizations page, select the insight for which you want to create a GitHub issue.

  2. In the insights details pane, select Create Work Item.

    Screenshot of Code Optimizations details pane and selecting the create work item button.

  3. In the Create Work Item pane, from Work Item Service, select GitHub.

  4. From the Project menu, select the GitHub repository with GitHub Copilot coding agent enabled.

  5. Turn on the Assign to GitHub Copilot option.

    Screenshot of the checked Assign to GitHub Copilot option.

  6. Select Create Work Item.

  7. When prompted with a warning about leaving the Azure portal, select Continue to finish creating the GitHub issue.

Track the pull request opened by GitHub Copilot

After you create the issue in GitHub, GitHub Copilot:

  1. Responds to the issue with the eyes emoji (👀).
  2. Opens a pull request as the assignee.

The GitHub issue includes special instructions for the Copilot coding agent to fix and validate your specific performance issue.

  • Copilot benchmarks your code before and after the performance code suggestion.
  • Copilot considers and evaluates multiple alternative solutions.

This process takes a couple minutes to finish. When the process finishes, the Copilot agent updates the pull request details and the title.

To review Copilot's changes:

  • Ask Copilot to make changes by using pull request comments.
  • Check out Copilot's branch and commit changes yourself.

Next step