|
| 1 | +--- |
| 2 | +title: GitHub Copilot in the .NET Aspire dashboard |
| 3 | +description: Learn how to use GitHub Copilot in the .NET Aspire dashboard. |
| 4 | +ms.date: 05/19/2025 |
| 5 | +ms.topic: reference |
| 6 | +--- |
| 7 | + |
| 8 | +# GitHub Copilot in the .NET Aspire dashboard |
| 9 | + |
| 10 | +Introducing GitHub Copilot in the .NET Aspire dashboard! GitHub Copilot is your new AI debugging assistant. |
| 11 | + |
| 12 | +GitHub Copilot supercharges the dashboard's OpenTelemetry debugging and diagnostics experience. With AI, you can: |
| 13 | + |
| 14 | +- Review hundreds of log messages with a single click |
| 15 | +- Investigate the root cause of errors across multiple apps |
| 16 | +- Highlight performance issues in traces |
| 17 | +- Explain obscure error codes using AI's huge knowledge repository |
| 18 | + |
| 19 | +You'll have access to Copilot in the dashboard when you launch your app from VS Code or Visual Studio. |
| 20 | + |
| 21 | +## Requirements |
| 22 | + |
| 23 | +GitHub Copilot is only available when a .NET Aspire project is run from an IDE. |
| 24 | + |
| 25 | +> [!div class="checklist"] |
| 26 | +> |
| 27 | +> - VS Code and C# Dev Kit 1.19.63 or later. |
| 28 | +> - Visual Studio 17.14 or later. |
| 29 | +
|
| 30 | +You must also be logged into a GitHub account in the IDE that has a GitHub Copilot subscription. Copilot interactions in the .NET Aspire dashboard use the GitHub account associated with your IDE. |
| 31 | + |
| 32 | +If you don't have a Copilot subscription yet, you can use Copilot for free by signing up for the [Copilot Free plan](https://aka.ms/dotnet/aspire/copilot-free-signup), which includes a monthly limit of chat interactions. |
| 33 | + |
| 34 | +## Get started |
| 35 | + |
| 36 | +To get started, launch your .NET Aspire solution as usual in your IDE. |
| 37 | + |
| 38 | +1. Open your .NET Aspire solution in a supported version of Visual Studio or VS Code with the [C# Dev Kit extension](/visualstudio/subscriptions/vs-c-sharp-dev-kit) installed. |
| 39 | +2. Ensure you're logged into the IDE with a GitHub account: |
| 40 | + - For Visual Studio, see [Add your GitHub accounts to your Visual Studio keychain](https://aka.ms/dotnet/aspire/copilot-vs-login). |
| 41 | + - For VS Code and C# Dev Kit, see [Set up GitHub Copilot in VS Code](https://aka.ms/dotnet/aspire/copilot-vscode-login). |
| 42 | +3. Run the .NET Aspire app host. |
| 43 | + |
| 44 | +A GitHub Copilot button appears in the top-right corner of the dashboard. Selecting the button opens the Copilot UI. |
| 45 | + |
| 46 | +:::image type="content" source="media/copilot/copilot-headerbutton.png" lightbox="media/copilot/copilot-headerbutton.png" alt-text="A screenshot of the dashboard with the GitHub Copilot button highlighted."::: |
| 47 | + |
| 48 | +In the Copilot UI, you can either select a suggested question, such as **Summarize resources**, or enter your own question in the chat input field. Press <kbd>Enter</kbd> to submit. For example: `What health checks are configured in my app?` |
| 49 | + |
| 50 | +:::image type="content" source="media/copilot/copilot-chatquestion.png" lightbox="media/copilot/copilot-chatquestion.png" alt-text="A screenshot of the dashboard with GitHub Copilot open. It contains a chat question and answer."::: |
| 51 | + |
| 52 | +At the top of the Copilot UI are buttons to start a new conversation, expand the chat, or close the UI. |
| 53 | + |
| 54 | +## Analyze resources, console logs, and telemetry |
| 55 | + |
| 56 | +There are several options for analyzing resources, console logs, and telemetry in your app. Two were discussed above: |
| 57 | + |
| 58 | +- Select a suggested question. Copilot's suggested questions are contextual. For example, questions about resources appear on the resources page, and questions about distributed traces appear on the traces page. |
| 59 | +- Enter your own question in the chat input field, such as `Why did the product cache fail to start?` or `What caused recent errors in the frontend?` |
| 60 | + |
| 61 | +The dashboard also includes a Copilot option in the context menus for resources, structured logs, traces, and spans. Select **Ask GitHub Copilot** to investigate the selected data. |
| 62 | + |
| 63 | +:::image type="content" source="media/copilot/resources-askcopilot.png" lightbox="media/copilot/resources-askcopilot.png" alt-text="A screenshot of the Ask GitHub Copilot option in the resource context menu page."::: |
| 64 | + |
| 65 | +If your app has structured logs or traces with errors, an **Explain errors** button appears on those pages. Selecting it makes all errors available to Copilot for investigation. |
| 66 | + |
| 67 | +:::image type="content" source="media/copilot/structuredlogs-explainerror.png" lightbox="media/copilot/structuredlogs-explainerror.png" alt-text="A screenshot of the structured logs page with an Explain errors button."::: |
| 68 | + |
| 69 | +On the trace details page, the **Explain trace** button is always visible. It provides a quick way to analyze the currently viewed trace. |
| 70 | + |
| 71 | +:::image type="content" source="media/copilot/tracedetails-explaintrace.png" lightbox="media/copilot/tracedetails-explaintrace.png" alt-text="A screenshot of the trace details page with an Explain trace button."::: |
| 72 | + |
| 73 | +## Troubleshooting |
| 74 | + |
| 75 | +### Copilot hangs on "Getting ready" |
| 76 | + |
| 77 | +A known issue can cause the Copilot UI to hang with a "Getting ready" message when it is first accessed. This occurs when the dashboard is not launched from a [supported version](#requirements) of Visual Studio or VS Code, or when no GitHub account is logged into the IDE. Closing and reopening the Copilot UI fixes the issue. Once fixed, the UI correctly displays a message with requirements for using the dashboard with GitHub Copilot. |
| 78 | + |
| 79 | +### Reached monthly limit of Copilot Free plan |
| 80 | + |
| 81 | +The GitHub Copilot Free plan includes a monthly limit on chat usage. When this limit is exceeded, Copilot will no longer function in the dashboard. [Upgrade your Copilot subscription](https://aka.ms/dotnet/aspire/copilot-pro) or wait for the limit to reset. |
| 82 | + |
| 83 | +## Limitations |
| 84 | + |
| 85 | +### Data size |
| 86 | + |
| 87 | +AI models have limits on how much data they can process at once. The .NET Aspire dashboard may limit the amount of data sent to GitHub Copilot when necessary. |
| 88 | + |
| 89 | +- Large data fields (e.g., long exception stack traces) may be truncated. |
| 90 | +- Requests involving large collections of telemetry may be shortened by omitting older items. |
| 91 | + |
| 92 | +## Disable GitHub Copilot in the dashboard |
| 93 | + |
| 94 | +GitHub Copilot only accesses data when you explicitly interact with it. For example, submitting a chat query or selecting **Ask GitHub Copilot** from a context menu. |
| 95 | + |
| 96 | +If you prefer to disable the feature entirely, set the `ASPIRE_DASHBOARD_AI_DISABLED` environment variable to `true` in your app host's _launchSettings.json_ file. This hides all Copilot UI elements in the dashboard. |
| 97 | + |
| 98 | +:::code language="json" source="snippets/DisableAI/AspireApp/AspireApp.AppHost/Properties/launchSettings.json" highlight="14"::: |
| 99 | + |
| 100 | +## GitHub Copilot frequently asked questions |
| 101 | + |
| 102 | +For more information about GitHub Copilot, such as questions around plans, privacy and responsible AI usage, see the [GitHub Copilot frequently asked questions](https://github.com/features/copilot#faq). |
0 commit comments