-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[Draft] Add docs for dotnet migration support for copilot cli #49730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
43a659c
83029c4
b5fb4fe
7bc4367
c583ca0
2a95d37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| --- | ||
| title: Migrate .NET Apps to Azure Using GitHub Copilot App Modernization in Coding Agent | ||
| description: Provides an overview of how .NET developers can migrate applications to Azure using GitHub Copilot App Modernization in Copilot Coding Agent. | ||
| ms.author: ninpan | ||
| ms.reviewer: jessiehuang | ||
| ms.topic: overview | ||
| ms.date: 11/14/2025 | ||
| ms.custom: devx-track-dotnet | ||
| ms.subservice: migration-copilot | ||
| --- | ||
|
|
||
| # Migrate .NET Apps Using GitHub Copilot App Modernization in Coding Agent | ||
|
|
||
| ## Overview | ||
|
|
||
| This article provides an overview of how .NET developers can migrate their applications using **GitHub Copilot app modernization** within the [**Copilot Coding Agent**](https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent). The agent can work independently in the background to complete modernization tasks—just like a human developer. Developers can delegate tasks via issues or pull requests, and the agent executes them in the cloud, helping teams complete the entire modernization journey efficiently. | ||
|
|
||
| >[!NOTE] | ||
| >Copilot coding agent is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. The agent is available in all repositories stored on GitHub, except repositories owned by managed user accounts and where it has been explicitly disabled. | ||
|
|
||
| ## Prerequisites | ||
| - [**Copilot Coding Agent**](https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent) configured | ||
| - A GitHub Copilot Pro, Pro+, Business, or Enterprise subscription | ||
| - A GitHub repo | ||
| - A Copilot environment with .NET 10 SDK installed (for dnx command to run), See [customize the agent environment](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment) for more details. To install the .NET 10 SDK, add the following steps in the `copilot-setup-steps.yml`: | ||
| ``` | ||
| - name: Setup .NET 10 | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: '10.x' | ||
|
|
||
| - name: Verify .NET 10 | ||
| run: | | ||
| dotnet --info | ||
| ``` | ||
|
|
||
| ## Getting Started | ||
| 1. Go to the Settings of the target repository you want to modernize.(You must be an admin of this repository) | ||
| 2. Select Copilot, then click "Coding Agent". | ||
| 3. Under MCP Configuration in the Model Context Protocol (MCP) section, manually add the following configuration, and click "Save Configuration": | ||
| ``` | ||
| { | ||
| "mcpServers": { | ||
| "DotNetAppModMcpServer-migrate": { | ||
| "type": "local", | ||
| "command": "dnx", | ||
| "tools": [ | ||
| "*" | ||
| ], | ||
| "args": [ | ||
| "Microsoft.AppModernization.McpServer.DotNet.Migration", | ||
| "--yes", | ||
| "--source", | ||
| "https://api.nuget.org/v3/index.json" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| :::image type="content" source="./media/coding-agent/mcp.png" lightbox="./media/coding-agent/mcp.png" alt-text="Screenshot of MCP configuration in coding agent"::: | ||
| 4. (Optional) If environment variables are required, set them under Environment → Copilot in the settings. These environment variables will be initialized automatically the first time a user invokes an agentic task in this repository. | ||
| 5. Save the MCP configuration. | ||
|
|
||
| ### Migrate your .NET Application to Azure | ||
| To migrate your .NET application to Azure, describe your migration scenario for Coding Agent. | ||
|
|
||
| For details on predefined migration tasks, see [migration tasks](predefined-tasks.md). | ||
| For example: | ||
| ``` | ||
| Migrate this project from local file IO to Azure Blob Storage | ||
| Migrate this project from local sql server to Azure SQL DB with managed identity | ||
| Migrate this project from file based logging to OpenTelemetry | ||
| ``` | ||
|
|
||
| Start by opening the Agents panel in the top-right corner and enter your prompt. After the prompt is entered, Copilot will start a new session and open a new Pull Request, which will appear in the list below the prompt box. Copilot will work on the task and then add you as a reviewer when it has finished, triggering a notification. | ||
|
|
||
| :::image type="content" source="./media/coding-agent/migrate-input.png" lightbox="./media/coding-agent/migrate-input.png" alt-text="Screenshot of .NET migrate task input in Coding Agent"::: | ||
|
|
||
| After the migration starts, you can monitor the progress: | ||
| :::image type="content" source="./media/coding-agent/migrate-progress.png" lightbox="./media/coding-agent/migrate-progress.png" alt-text="Screenshot of .NET migrate progress in Coding Agent"::: | ||
|
|
||
| Finally, you can review the migration summary for insights — ensuring your app is fully migrated and cloud-ready. | ||
| :::image type="content" source="./media/coding-agent/migrate-completion.png" lightbox="./media/coding-agent/migrate-completion.png" alt-text="Screenshot of .NET migrate completion in Coding Agent"::: | ||
|
|
||
| ### Deploy your .NET Application to Azure | ||
| After migrating your application, you can deploy it directly from Coding Agent by following prompt examples: | ||
| ``` | ||
| Deploy this application to Azure | ||
| ``` | ||
|
|
||
| You can follow the same steps as migration for deployment — the overall process remains consistent. | ||
|
|
||
| ## Provide Feedback | ||
| If you have any feedback about GitHub Copilot agent, please let us know your [feedback](https://aka.ms/ghcp-appmod/feedback). | ||
|
|
||
| ## Reference | ||
| - [Using GitHub Copilot agent](https://docs.github.com/en/copilot/how-tos/use-copilot-agents). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| title: Migrate .NET Apps to Azure Using GitHub Copilot App Modernization in Copilot CLI | ||
| description: Provides an overview of how .NET developers can migrate applications to Azure using GitHub Copilot App Modernization in the Copilot CLI. | ||
| ms.topic: concept-article | ||
| ms.custom: devx-track-dotnet | ||
| ms.date: 11/11/2025 | ||
| author: alexwolfmsft | ||
| ms.author: alexwolf | ||
| ms.reviewer: jessiehuang | ||
| --- | ||
|
|
||
| # Migrate .NET Apps to Azure Using GitHub Copilot App Modernization in Copilot CLI | ||
|
|
||
| ## Overview | ||
|
|
||
| This article provides an overview of how .NET developers can migrate their applications to Azure using **GitHub Copilot App Modernization** within the [**Copilot CLI**](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli), enabling them to modernize applications wherever they code. It’s currently in public preview — give it a try and let us know if any [feedback](https://aka.ms/ghcp-appmod/feedback). | ||
| :::image type="content" source="./media/copilot-cli-entrance.png" lightbox="./media/copilot-cli-entrance.png" alt-text="Screenshot of app mod entrance in Copilot CLI"::: | ||
|
|
||
| >[!NOTE] | ||
| >GitHub Copilot CLI is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. | ||
| >If you receive Copilot from an organization, the Copilot CLI policy must be enabled in the organization's settings. | ||
|
|
||
| ## Why Use Copilot CLI with App Modernization | ||
| - Run modernization tasks directly from the terminal — no need to switch to an IDE | ||
| - Supports both interactive (human-in-the-loop) and batch workflows | ||
|
Comment on lines
+23
to
+25
|
||
|
|
||
| ## Prerequisites | ||
| - [Install Copilot CLI](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) | ||
| - A GitHub Copilot subscription, See [Copilot plans](https://github.com/features/copilot/plans?ref_product=copilot) | ||
|
||
| - .NET 10 SDK installed (for dnx command to run), [download .NET 10 here](https://dotnet.microsoft.com/download/dotnet/10.0) | ||
|
|
||
| ## Getting Started | ||
| 1. In your terminal, navigate to the .NET project folder containing the code you want to work on. | ||
| 2. Enter `copilot` to start Copilot CLI. | ||
| ``` | ||
| copilot | ||
| ``` | ||
| Copilot will ask you to confirm that you trust the files in this folder. Refer to [Using Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli#trusted-directories) | ||
|
||
| Choose one of the options: | ||
|
Comment on lines
+38
to
+39
|
||
| - Yes, proceed: Copilot can work with the files in this location for this session only. | ||
| - Yes, and remember this folder for future sessions: You trust the files in this folder for this and future sessions. You won't be asked again when you start Copilot CLI from this folder. Only choose this option if you are sure that it will always be safe for Copilot to work with files in this location. | ||
|
||
| - No, exit (Esc): End your Copilot CLI session. | ||
|
Comment on lines
+40
to
+42
|
||
| 3. You can add MCP servers by running `/mcp add` in Copilot CLI according to the configuration below, here is an example of adding .NET migration MCP: | ||
|
||
| ``` | ||
| /mcp add DotNetAppModMcpServer-migrate | ||
| ``` | ||
| And fill the columns with: | ||
| - Server Type: Local | ||
| - Command: dnx Microsoft.AppModernization.McpServer.DotNet.Migration --yes --source https://api.nuget.org/v3/index.json | ||
| - Environment Variables: keep empty | ||
| - Tools: use the default value "*" | ||
|
|
||
|
|
||
| Or by manually updating the `~/.config/mcp-config.json` file with the following info. Refer to [Add an MCP server](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli#add-an-mcp-server) | ||
|
||
| ``` | ||
| { | ||
| "mcpServers": { | ||
| "DotNetAppModMcpServer-migrate": { | ||
| "type": "local", | ||
| "command": "dnx", | ||
| "tools": [ | ||
| "*" | ||
| ], | ||
| "args": [ | ||
| "Microsoft.AppModernization.McpServer.DotNet.Migration", | ||
| "--yes", | ||
| "--source", | ||
| "https://api.nuget.org/v3/index.json" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| You can run `/mcp show` to verify the MCP servers are correctly configured. | ||
|
||
| ``` | ||
| /mcp show | ||
| ``` | ||
| 4. Execute the migration task in Copilot CLI | ||
|
||
| To migrate your .NET application to Azure, describe your migration scenario in Copilot CLI. | ||
| Basically, you can instruct the Copilot CLI to do any migration task for you via "migrate from X to Y" for you. And we provide some predefined migration scenarios with Microsoft best practices. | ||
| For details on predefined migration tasks, see [migration tasks](predefined-tasks.md) | ||
| Some examples you can start with: | ||
| ``` | ||
| Migrate this app from local file IO to Azure Blob Storage | ||
| Migrate this app from local sql server to Azure SQL DB with managed identity | ||
| Migrate this app from file based logging to OpenTelemetry | ||
| ``` | ||
|
|
||
| Then the migration task will be executed and showing progress in Copilot CLI | ||
|
||
| :::image type="content" source="./media/migrate-details.png" lightbox="./media/migrate-details.png" alt-text="Screenshot of migrating .NET in Copilot CLI"::: | ||
|
|
||
| The project has been successfully migrated, with below summary: | ||
| :::image type="content" source="./media/migrate-summary.png" lightbox="./media/migrate-summary.png" alt-text="Screenshot of migrating .NET summary in Copilot CLI"::: | ||
|
|
||
| ## Provide Feedback | ||
| If you have any feedback about GitHub Copilot CLI, please let us know your [feedback](https://aka.ms/AM4DFeedback). | ||
|
|
||
| ## Reference | ||
| - [Using GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli#using-copilot-cli). | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "give it a try and let us know if any [feedback]" uses passive construction. Per the Markdown style guidelines, use active voice and imperative mood. Rephrase to "Try it out and share your [feedback]" or "Try it and let us know your [feedback]".