Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This quickstart shows you how to use GitHub Copilot App Modernization for Java (preview) to assess and migrate a Java project. In this quickstart, you install and configure the extension, then assess and migrate a sample project. For example, you use a predefined formula to update an Azure SQL database connection to use Azure Managed Identity instead of a username and password.
The following video demonstrates how GitHub Copilot App Modernization for Java (preview) uses AppCAT to help assess a Java project for migration to Azure:
Prerequisites
A GitHub account with GitHub Copilot enabled. All plans are supported, including the Free plan.
The latest version of Visual Studio Code.
The latest version of the GitHub Copilot extension in Visual Studio Code.
GitHub Copilot App Modernization extension pack. For install instructions, see the next section.
This extension pack bundles the following two extensions:
- GitHub Copilot App Modernization for Java (preview)
- GitHub Copilot App Modernization - upgrade for Java (preview)
App Modernization doesn't require Java in your local environment. However, to build your project successfully, install the correct version of Java and Maven. We recommend the Microsoft Build of OpenJDK and Maven.
AppCAT. This tool is required for the app assessment feature.
Sign in to use Copilot and then install App Modernization
To use GitHub Copilot, sign in to your GitHub account in Visual Studio Code. Select the Copilot icon at the top of Visual Studio Code to access the GitHub Copilot pane. For more information about setting up GitHub Copilot, see Set up GitHub Copilot in VS Code.
Then, use the following steps to install GitHub Copilot App Modernization for Java (preview):
- In Visual Studio Code, open the Extensions view from the Activity Bar.
- Search for GitHub Copilot App Modernization in the marketplace.
- Select the GitHub Copilot App Modernization for Java (preview) extension or the GitHub Copilot App Modernization extension pack.
- On the extension page, select Install.
- Restart Visual Studio Code.
After installation completes, you should see a notification in the corner of Visual Studio Code confirming success.
For more information, see Install a VS Code extension.
Assess cloud readiness
Use the following steps to start your migration process with solution assessment. This assessment helps you understand what your cloud readiness challenges are and how impactful they are, provides recommended solutions. A solution recommendation includes references to set up Azure resources, add configurations, and make code changes.
Clone the Java migration copilot samples repository.
In Visual Studio Code, open the mi-sql-public-demo project folder in the samples repository.
On the sidebar, select the App Modernization for Java pane, and then, in the Assessment section, select Assess.
The GitHub Copilot chat window with agent mode is opened to call the modernization assessor to execute the App Modernization assessment.
Select Continue to confirm.
The modernization assessor now opens assessment.md. This file is the configuration for running AppCAT, which performs the app assessment. AppCAT asks for your confirmation to continue. You can examine its content and make changes there, if necessary.
The modernization assessor verifies your local environment first. If the AppCAT and its dependencies aren't installed, then you need to install them first. For more information, see Azure Migrate application and code assessment for Java version 7 (Preview). After installation, it calls AppCAT to assess the current project. This step could take several minutes to complete.
Upon completion of the analysis, the modernization assessor produces a categorized view of cloud readiness issues in an opened summary report.
When reviewing the summary report, you can select Propose Solution and move to the next step, where you choose your desired solution per category/sub category.
Confirm the selection of the Migrate to Azure SQL Database (SDK on Public Cloud) solution by selecting Confirm solution to proceed to the migration step. Then, select Migrate for the Migrate to Azure SQL Database (SDK on Public Cloud) solution to move to the code remediation stage.
Apply a predefined formula
The migration Copilot provides predefined formulas for common migration scenarios that you might face when migrating to Azure. For example, with the mi-sql-public-demo sample, the Managed Identity formulas change the Azure SQL database connection to use Azure Managed Identity instead of a username and password.
In the Solution Report, select Migrate. The Copilot chat window opens with Agent Mode.
Select Continue repeatedly to confirm each tool action in the Copilot Chat window. The Copilot agent uses various tools for App Modernization and each tool requires confirmation to proceed.
After each step, manually input continue to confirm and proceed.
Wait for the code changes to be generated.
Apply the Build-Fix tool
Use the following steps to apply the Build-Fix tool:
When the Java Application Build-Fix tool is suggested, select Continue to build the project and fix errors. This tool attempts to resolve any build errors in up to 10 iterations.
After the Build-Fix tool begins, select Continue to proceed and show progress.
After the process finishes, review the code changes and confirm them by selecting Keep.