This document serves as a comprehensive workshop guide that will walk you through the process of migrating a Java application to Azure using GitHub Copilot app modernization. The workshop covers assessment, database migration from Oracle to PostgreSQL, and deployment to Azure.
What the Migration Process Will Do: The migration will transform your application from using Oracle Database to a modern Azure-native solution. This includes migrating from Oracle Database to Azure Database for PostgreSQL Flexible Server with managed identity authentication, and deploying it to Azure with proper monitoring and health checks.
The Photo Album application is a Spring Boot web application that allows users to:
- Upload photos via drag-and-drop or file selection
- View photos in a responsive gallery
- View photo details with metadata
- Navigate between photos
- Delete photos
Original State (Before Migration):
- Oracle Database 21c Express Edition for photo storage
- Photos stored as BLOBs in Oracle Database
- Password-based authentication
- Running in Docker containers locally
After Migration:
- Azure Database for PostgreSQL Flexible Server
- Managed Identity passwordless authentication
- Deployed to Azure Container Apps
Time Estimates: The complete workshop takes approximately 40 minutes to complete. Here's the breakdown for each major step:
- Assess Your Java Application: ~5 minutes
- Migrate from Oracle to PostgreSQL: ~15 minutes
- Deploy to Azure: ~20 minutes
Before starting this workshop, ensure you have:
- Operating System: Windows, macOS, or Linux
- Java Development Kit (JDK): JDK 21 or higher
- Download from Microsoft OpenJDK
- Maven: 3.8.0 or higher
- Download from Apache Maven
- Git: For version control
- Download from Git
- Visual Studio Code: Version 1.101 or later
- Download from Visual Studio Code
- GitHub Copilot: Must be enabled in your GitHub account
- GitHub Copilot subscription (Pro, Pro+, Business, or Enterprise)
- VS Code Extensions (Required):
- GitHub Copilot extension
- Install from VS Code Marketplace
- Sign in to your GitHub account within VS Code
- GitHub Copilot app modernization extension
- Install from VS Code Marketplace
- Restart VS Code after installation
- Bicep extension
- Install from VS Code Marketplace
- GitHub Copilot extension
- Azure Account: Active Azure subscription
- Create a free account if you don't have one
- Azure CLI: Latest version
- Download from Azure CLI
- After installation, login and set your subscription:
az login az account set --subscription "<your-subscription-id>"
- Install the Container Apps extension:
az extension add --name containerapp
-
Ensure
chat.extensionTools.enabledis set totruein VS Code settings -
In the Visual Studio Code settings, make sure this setting is enabled (it might be controlled by your organization)
-
Access to public Maven Central repository for Maven-based projects
-
Git-managed Java project using Maven
-
Ensure the following tools are selected:
- Built-in
- GitHub Copilot app modernization Deploy
- GitHub Copilot app modernization
- GitHub Copilot modernization - upgrade for Java
This section is optional. Before starting the migration, you can run the original Oracle-based application locally to understand how it works.
Required: Docker Desktop (Latest version)
- Download from Docker
-
Clone the repository (if not already done):
git clone https://github.com/Azure-Samples/PhotoAlbum-Java-Lite.git cd PhotoAlbum-Java-Lite -
Start the application:
docker-compose up --build -d
This will:
- Start Oracle Database 21c Express Edition container
- Build and start the Photo Album application container
- Automatically create the database schema
-
Wait for services to start (~2-3 minutes for Oracle DB initialization on first run)
-
Access the application:
- Open your browser to http://localhost:8080
- Upload, view, and manage photos to explore the features
-
Stop the application:
docker-compose down
To remove data volumes as well:
docker-compose down -v
The first step is to assess the Photo Album application to identify migration opportunities and potential issues.
- Clone or open the Photo Album project in Visual Studio Code:
git clone https://github.com/Azure-Samples/PhotoAlbum-Java-Lite.git
cd PhotoAlbum-Java-Lite
code .In VS Code, open the Extensions view from the Activity Bar, search for the GitHub Copilot app modernization extension in the marketplace. Click the Install button for the extension. After installation completes, you should see a notification in the bottom-right corner of VS Code confirming success.
-
In the Activity sidebar, open the GitHub Copilot app modernization extension pane.
-
In the QUICKSTART section, click Start Assessment to trigger the app assessment.
-
Wait for the assessment to be completed. This step could take several minutes.
-
Upon completion, an Assessment Report tab opens. This report provides a categorized view of cloud readiness issues and recommended solutions. Select the Issues tab to view proposed solutions and proceed with migration steps.
The Assessment Report provides:
- Application Information: Summary of detected technologies and frameworks
- Issues: Categorized list of migration opportunities
- Database Migration: Oracle Database → Azure Database for PostgreSQL
- Security: Current password-based authentication
- Recommended Solutions: Predefined migration tasks for each issue
Look for the following in your report:
-
Database Migration (Oracle Database)
- Detected: Oracle Database 21c
- Recommendation: Migrate to Azure Database for PostgreSQL Flexible Server
- Action: Run Task button available
Before running the migration task in Copilot Chat, make sure the chat is configured to use your preferred LLM model, to choose the model:
-
Open Copilot Chat in Agent mode.
-
Select the custom agent modernize-azure-java from the agent picker.
-
Select the a model from the model picker, e.g., GPT-5.3-Codex.
Now that you've assessed the application, let's begin the database migration from Oracle to Azure Database for PostgreSQL.
-
In the Assessment Report, locate the Database Migration (Oracle) issue
-
Click the Run Task button next to Migrate to Azure Database for PostgreSQL (Spring)
-
The Copilot Chat panel opens in Agent Mode with a pre-populated migration prompt
-
The Copilot Agent will analyze the project, generate and open plan.md and progress.md, then automatically proceed with the migration process.
-
The agent checks the version control system status and checks out a new branch for migration, then performs the code changes. When prompted to confirm an action, click Allow for tool call requests. Tip: To minimize disruption, open the dropdown menu and select Allow all commands in this session.
-
When the code migration is complete, the agent will automatically run a validation and fix iteration loop which includes:
- CVE Validation: Detects Common Vulnerabilities and Exposures in current dependencies and fixes them.
- Build Validation: Attempts to resolve any build errors.
- Consistency Validation: Analyzes the code for functional consistency.
- Test Validation: Runs unit tests and automatically fixes any failures.
- Completeness Validation: Catches migration items missed in the initial code migration and fixes them.
-
After all validations complete, the agent generates a summary.md as the final step.
-
Review the proposed code changes and click Keep to apply them.
At this point, you have successfully migrated the database to PostgreSQL. Now, you can deploy the application to Azure. You can choose one of the two options:
- Provision New Infrastructure and Deploy
- Deploy to Existing Azure Resources
Follow this section when you don't have any prepared Azure resources and let the Copilot Agent help provision the necessary infrastructure and deploy the application.
-
Switch to the default agent for deployment:
- Open Copilot Chat
- Select the agent from the agent picker (not
modernize-azure-java) - Be sure to enable the "GitHub Copilot app modernization Deploy" in the tool picker
-
In the Activity sidebar, open the GitHub Copilot app modernization extension pane. In the TASKS section, expand Common Tasks > Deployment Tasks. Click the run button for Provision Infrastructure and Deploy to Azure.
-
The Copilot Chat panel opens in Agent Mode and will be populated with a predefined prompt.
-
Select
Azure Container Appsin pop-up question box. Provide information as requested. Click Continue/Allow in pop-up notifications to let Copilot Agent analyze the project and create a deployment plan in plan.copilotmd with Azure resources architecture, recommended Azure resources for project and security configurations, and execution steps for deployment. -
View the architecture diagram, resource configurations, and execution steps in the plan. Copilot will automatically execute the deployment steps.
-
When prompted, click Continue/Allow in chat notifications as Copilot Agent follows the plan and leverages agent tools to create and run provisioning and deployment scripts, fix potential errors, and finish the deployment. You can also check the deployment status in progress.copilotmd.
-
Clean up new provisioned resources after the workshop. Find the resource group name used for deployment in the
plan.copilotmd,progress.copilotmd, orsummary.copilotmdfile. Navigate to the resource group in the Azure Portal, review the resources, and delete the resource group to clean up all resources created during the deployment. You can also use Azure CLI to list the resources and delete the resource group:az resource list --resource-group <your-resource-group-name> az group delete --name <your-resource-group-name> --yes --no-wait
Follow this section if you already have the necessary Azure resources provisioned and just want to deploy the application to those existing resources.
-
Switch to the default agent for deployment:
- Open Copilot Chat
- Select the agent from the agent picker (not
modernize-azure-java) - Be sure to enable the "GitHub Copilot app modernization Deploy" in the tool picker
-
Check if you have the necessary Azure resources in a resource group for this project. Refer to azure-setup.ps1 to set up the required resources, which include:
- Azure Container Apps (with Azure Container Apps Environment and Azure Log Analytics Workspace as dependencies)
- Azure Database for PostgreSQL Flexible Server with a database created
- Azure Container Registry
- Azure Key Vault (to securely store database credentials and other secrets)
- Azure User-assigned Managed Identity (for secure access to ACR and Key Vault)
-
In the Activity sidebar, open the GitHub Copilot app modernization extension pane. In the TASKS section, expand Common Tasks > Deployment Tasks. Click the run button for Deploy to Existing Azure Infrastructure.
-
The Copilot Chat panel opens in Agent Mode and will be populated with a predefined prompt. Provide the necessary information such as Azure subscription, resource group name in pop-up notifications or use direct prompt, e.g.
The resource group name is <resource-group-name>. Click Continue/Allow to let Copilot Agent take some time to analyze the project and validate the existing infrastructure. -
Copilot will then create a deployment plan in plan.copilotmd with execution steps for deployment. Copilot will automatically start to execute the deployment steps. Click Continue/Allow to let Copilot Agent proceed. Check the deployment progress in progress.copilotmd.
-
Ask Copilot Agent to visit the application URL with a prompt e.g.
Visit the application URL and check if the application is running fine after deployment.












