This MicroHack scenario walks through a complete migration and modernization journey using Azure Migrate and GitHub Copilot. The experience covers discovery, assessment, business case development, and application modernization for both .NET and Java workloads.
This MicroHack provides hands-on experience with the entire migration lifecycle - from initial discovery of on-premises infrastructure through to deploying modernized applications on Azure. You'll work with a simulated datacenter environment and use AI-powered tools to accelerate modernization.
Key Technologies:
- Azure Migrate for discovery and assessment
- GitHub Copilot for AI-powered code modernization
- Azure App Service for hosting modernized applications
Jump to individual challenges:
- Challenge 1 - Infrastructure: Prepare a migration environment
- Challenge 2 - Infrastructure: Analyze data & build a business case
- Challenge 3 - .NET app modernization
- Challenge 4 - Java app modernization
Install Azure PowerShell and authenticated to your Azure subscription:
Install-Module Az
Connect-AzAccountPlease note:
- You need Administrator rights to install Azure PowerShell. If it's not an option for you, install it for the current user using
Install-Module Az -Scope CurrentUser - It takes some time (around 10 minutes) to install. Please, complete this task in advance.
- If you have multiple Azure subscriptions avaialble for your account, use
Connect-AzAccount -TenantId YOUR-TENANT-IDto authenticate against specific one.
Once you are authenticated to Azure via PowerShell, run the following script to create the lab environment:
# Download and execute the environment creation script directly from GitHub
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/crgarcia12/migrate-modernize-lab/refs/heads/main/lab-creation/New-MicroHackEnvironment.ps1" -OutFile "$env:TEMP\New-MicroHackEnvironment.ps1"
& "$env:TEMP\New-MicroHackEnvironment.ps1"Business Scenario: You're working with an organization that has on-premises infrastructure running .NET and Java applications. Your goal is to assess the environment, build a business case for migration, and modernize applications using best practices and AI assistance.
After completing this MicroHack you will:
- Understand how to deploy and configure Azure Migrate for infrastructure discovery
- Know how to build compelling business cases using Azure Migrate data
- Analyze migration readiness across servers, databases, and applications
- Use GitHub Copilot to modernize .NET Framework applications to modern .NET
- Leverage AI to migrate Java applications from AWS dependencies to Azure services
- Deploy modernized applications to Azure App Service
This MicroHack has specific prerequisites to ensure optimal learning experience.
Required Access:
- Azure Subscription with Contributor permissions
- GitHub account with GitHub Copilot access
Required Software:
- Visual Studio 2022 (for .NET modernization)
- Visual Studio Code (for Java modernization)
- Docker Desktop
- Java Development Kit (JDK 8 and JDK 21)
- Maven
Azure Resources: The lab environment provides:
- Resource Group:
on-prem - Hyper-V host VM with nested virtualization
- Pre-configured virtual machines simulating datacenter workloads
- Azure Migrate project with sample data
Estimated Time:
- Challenge 1: 45-60 minutes
- Challenge 2: 30-45 minutes
- Challenge 3: 45-60 minutes
- Challenge 4: 60-75 minutes
- Total: 3-4 hours
Set up Azure Migrate to discover and assess your on-premises infrastructure. You'll install and configure an appliance that collects data about your servers, applications, and dependencies.
Understand Your Environment:
- Access the Azure Portal using the provided credentials
- Navigate to the
on-premresource group - Connect to the Hyper-V host VM (
lab@lab.LabInstance.Id-vm) - Explore the nested VMs running inside the host
- Verify that applications are running (e.g., http://172.100.2.110)
Create Azure Migrate Project:
- Create a new Azure Migrate project in the Azure Portal
- Name your project (e.g.,
migrate-prj) - Select an appropriate region (e.g., Canada)
Deploy the Azure Migrate Appliance:
- Generate a project key for the appliance
- Download the Azure Migrate appliance VHD file
- Extract the VHD inside your Hyper-V host (F: drive recommended)
- Create a new Hyper-V VM using the extracted VHD:
- Name:
AZMAppliance - Generation: 1
- RAM: 16384 MB
- Network: NestedSwitch
- Name:
- Start the appliance VM
Configure the Appliance:
- Accept license terms and set appliance password:
Demo!pass123
- Wait for Azure Migrate Appliance Configuration to load in browser
- Paste and verify your project key
- Login to Azure through the appliance interface
- Add Hyper-V host credentials (username:
adminuser, password:demo!pass123)
- Add discovery source with Hyper-V host IP:
172.100.2.1
- Add credentials for Windows, Linux, SQL Server, and PostgreSQL workloads
- Start the discovery process
- ✅ You have successfully connected to the Hyper-V host VM
- ✅ You can access nested VMs and verify applications are running
- ✅ Azure Migrate project has been created
- ✅ Appliance is deployed and connected to Azure Migrate
- ✅ All appliance services show as running in Azure Portal
- ✅ Discovery process has started collecting data from your environment
- Azure Migrate Overview
- Azure Migrate Appliance Architecture
- Hyper-V Discovery with Azure Migrate
- Azure Migrate Discovery Best Practices
Transform raw discovery data into actionable insights by cleaning data, grouping workloads, creating business cases, and performing technical assessments to guide migration decisions.
Review Data Quality:
- Navigate to your Azure Migrate project overview
- Open the Action Center to identify data quality issues
- Review common issues (powered-off VMs, connection failures, missing performance data)
- Understand the impact of data quality on assessment accuracy
Group Workloads into Applications:
- Navigate to Applications page under "Explore applications"
- Create a new application definition for "ContosoUniversity"
- Set application type as "Custom" (source code available)
- Link relevant workloads to the application
- Filter and select all ContosoUniversity-related workloads
- Set criticality and complexity ratings
Build a Business Case:
- Navigate to Business Cases section
- Create a new business case named "contosouniversity"
- Select "Selected Scope" and add ContosoUniversity application
- Choose target region: West US 2
- Configure Azure discount: 15%
- Build the business case and wait for calculations
Analyze an Existing Business Case:
- Open the pre-built "businesscase-for-paas" business case
- Review annual cost savings and infrastructure scope
- Examine current on-premises vs future Azure costs
- Analyze CO₂ emissions reduction estimates
- Review migration strategy recommendations (Rehost, Replatform, Refactor)
- Examine Azure cost assumptions and settings
Perform Technical Assessments:
- Navigate to Assessments section
- Open the "businesscase-businesscase-for-paas" assessment
- Review recommended migration paths (PaaS preferred)
- Analyze monthly costs by migration approach
- Review Web Apps to App Service assessment details
- Identify "Ready with conditions" applications
- Review ContosoUniversity application details
- Check server operating system support status
- Identify out-of-support and extended support components
- Review PostgreSQL database version information
- Examine software inventory on each server
Complete Knowledge Checks:
- Find the count of powered-off Linux VMs
- Count Windows Server 2016 instances
- Calculate VM costs for the ContosoUniversity application
- Identify annual cost savings from the business case
- Determine security cost savings
- ✅ You understand data quality issues and their impact on assessments
- ✅ Applications are properly grouped with related workloads
- ✅ Business case successfully created showing cost analysis and ROI
- ✅ You can navigate between business cases and technical assessments
- ✅ Migration strategies (Rehost, Replatform, Refactor) are clearly understood
- ✅ Application readiness status is evaluated for cloud migration
- ✅ Out-of-support components are identified for remediation
- ✅ You can answer specific questions about your environment using Azure Migrate data
- Azure Migrate Business Case Overview
- Azure Assessment Best Practices
- Application Discovery and Grouping
- Migration Strategies: 6 Rs Explained
Modernize the Contoso University .NET Framework application to .NET 9 and deploy it to Azure App Service using GitHub Copilot's AI-powered code transformation capabilities.
This challenge can be completed using full Visual Studio (as written below) or VS Code if you don't have full Visual Studio. If using VS Code, skip the part about building/compiling the solution file.
Setup and Preparation:
- Navigate to
https://github.com/crgarcia12/migrate-modernize-laband click the "Fork" button in the top-right corner
- Select your account as the owner and click "Create fork"
- Once the fork is created, click the "Code" button and copy your forked repository URL
- Open Visual Studio 202x or VS Code.
- Select "Clone a repository" and paste your forked repository URL
- Navigate to Solution Explorer and locate the ContosoUniversity project
- If using VS 202x, Rebuild the project to verify it compiles successfully
Assess and Upgrade to .NET 9:
- Right-click the ContosoUniversity project and select "Modernize"
- Sign in to GitHub Copilot if prompted
- Select Claude Sonnet 4.5 as the model
- Click or instruct Copilot to "Upgrade to a newer .NET version"
- Allow GitHub Copilot to analyze the codebase
- Review the upgrade plan when presented
- Allow operations when prompted during the upgrade process
- Wait for the upgrade to complete (marked by
dotnet-upgrade-report.mdappearing)
Migrate to Azure:
- Right-click the project again and select "Modernize"
- Click "Migrate to Azure" in the GitHub Copilot Chat window
- Wait for GitHub Copilot to assess cloud readiness
Resolve Cloud Readiness Issues:
19. Open the dotnet-upgrade-report.md file
- Review the Cloud Readiness Issues section
- Click "Migrate from Windows AD to Microsoft Entra ID"
- Allow GitHub Copilot to implement the authentication changes
- Ensure all mandatory tasks are resolved
- Review the changes made to authentication configuration
Deploy to Azure:
- Allow GitHub Copilot to complete the Azure App Service deployment
- Verify the deployment succeeds
- Test the deployed application in Azure
- ✅ ContosoUniversity solution cloned and builds successfully
- ✅ Application upgraded from .NET Framework to .NET 9
- ✅ Upgrade report generated showing all changes and issues
- ✅ Authentication migrated from Windows AD to Microsoft Entra ID
- ✅ All mandatory cloud readiness issues resolved
- ✅ Application successfully deployed to Azure App Service
- ✅ Deployed application is accessible and functional
- GitHub Copilot for Visual Studio
- Modernize .NET Applications
- Migrate to .NET 9
- Azure App Service for .NET
- Microsoft Entra ID Authentication
Modernize the Asset Manager Spring Boot application for Azure by upgrading and replacing AWS S3 dependencies with Azure services through the GitHub Copilot App Modernization workflow.
- Fork https://github.com/sitoader/ghcp-java-app-moderization-sample/, clone your fork in your IDE, and confirm the project builds on the
mainbranch with JDK 8. - Use the GitHub Copilot App Modernization extension to run the guided assessment, upgrade, test generation, CVE scan, cloud migration, and containerization stages.
- Follow the guide below or use the more detailed guide in the repository
README.mdfile to perform all the necessary code steps to complete this challenge.
- Docker containers start successfully and the legacy app runs locally before changes.
- AppCAT completes with nine cloud readiness issues and four Java upgrade opportunities identified.
- CVE scan runs clean — no critical or high-severity vulnerabilities remain.
- The AWS S3 to Azure Blob Storage migration task executes with updated dependencies and configuration.
- All automated validation stages pass without unresolved issues.
- The modernized application starts locally using Azure Blob Storage with no storage errors.
- Migration activities are traceable through dedicated plan and progress artifacts for rollback readiness.
- IDE: Visual Studio Code or other IDE with the following extensions:
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- GitHub account with access to public repositories
- JDK 8 (for building the legacy app on
main) and JDK 21 (for the modernized app) — or use the included dev container - Maven 3.x (included via Maven Wrapper
./mvnw) - Docker Desktop installed and running (for containerization and local testing)
- Azure subscription with Contributor access to a resource group
- Azure CLI installed (Install guide)
- Azure Developer CLI (azd) installed (Install guide)
- Git configured with your GitHub credentials
- Basic familiarity with Java / Spring Boot web applications and Maven
The easiest way to get started is with the included dev container, which provides JDK 8, JDK 21, Maven, PostgreSQL, RabbitMQ, and Docker — all pre-configured. See DEV-SETUP.md for instructions.
- Open the Project: Open the cloned repository in VS Code on the
mainbranch - Open App Modernization: Open the GitHub Copilot App Modernization panel
- Start Assessment: Select "Start Assessment" to begin the assessment workflow
- Review the Report: A comprehensive assessment report is generated covering:
- Current state analysis (Java version, Spring Boot version, dependencies)
- Recommended target versions
- Potential breaking changes and blockers
- Understand the Scope: Review the detailed findings, including framework-specific recommendations and the full list of modernization tasks
- Initiate the Upgrade: In App Modernization, click Upgrade Java Runtime & Frameworks
- Review the Plan: The agent generates a step-by-step upgrade plan saved to
.github/java-upgrade/plan.md— review the incremental migration path (Java 8 → 17 → 21, Spring Boot 2.7 → 3.2 → 3.3) - Approve and Execute: Approve the plan and let the agent execute each step automatically — updating POM files, migrating
javax.*→jakarta.*imports, recompiling, and committing at each milestone - Review the Summary: Check
.github/java-upgrade/summary.mdfor upgrade results, technology stack diff, and any challenges encountered - Verify Build: Run
./mvnw clean compileto confirm the project compiles with Java 21 and Spring Boot 3.3
- Generate Tests: After the upgrade completes, GitHub Copilot suggests a Proceed option — click Generate unit tests
- Review Coverage Analysis: The agent identifies classes with no or insufficient test coverage across
webandworkermodules - Review Generated Tests: JUnit 5 + Mockito tests are generated targeting controllers, services, and message processors
- Run Tests: Execute
./mvnw clean testand confirm all tests pass - Target: Aim for meaningful coverage on critical business logic (controllers, services, processors)
- Trigger CVE Scan: In App Modernization, click Scan and Resolve CVEs
- Review the Report: Check the vulnerability report for critical/high severity issues in dependencies (Tomcat, Jackson, Spring Boot, PostgreSQL driver, etc.)
- Apply Fixes: Let Copilot upgrade dependency versions in the parent
pom.xml(Spring Boot BOM bump, version overrides) - Confirm Resolution: Re-scan to confirm 0 known vulnerabilities remaining — ask Copilot to generate a vulnerability assessment report
- Verify: Run
./mvnw clean verifyto confirm everything compiles and passes
- Review Cloud Readiness Tasks: In the assessment, check for AWS-specific dependencies (S3 SDK, configuration classes, storage services)
- Execute Migration: Run the migration task — the agent replaces AWS SDK with Azure SDK (
azure-storage-blob,azure-identity), migrates configuration and service classes, and updates templates - Review Changes: Confirm all AWS references are removed and Azure Blob Storage with
DefaultAzureCredentialis in place - Test Locally: Run with the dev profile (no Azure account needed):
SPRING_PROFILES_ACTIVE=dev ./mvnw -pl web spring-boot:run
- Test with Azure (optional): Create an Azure Storage account and blob container, then configure
azure.storage.account-nameandazure.storage.blob.containerinapplication.propertiesor as environment variables. Ensure you haveaz loginactive and Storage Blob Data Contributor role assigned.
- Start Containerization: In the assessment, execute the containerization task
- Review the Plan: The agent generates a plan covering Dockerfiles, Docker Compose, Bicep templates, and
azure.yaml - Execute the Plan: Approve and let the agent create all artifacts (multi-stage Dockerfiles,
docker-compose.yml,infra/main.bicep,azure.yaml) - Test Locally with Docker Compose:
Verify at
docker build -t assets-manager-web:latest -f web/Dockerfile . docker build -t assets-manager-worker:latest -f worker/Dockerfile . docker-compose up -d
http://localhost:8080(Web UI),http://localhost:15672(RabbitMQ) - Deploy to Azure:
azd auth login azd up
- Verify: Confirm the application is running on Azure Container Apps
- GitHub Copilot for VS Code
- Azure SDK for Java
- Migrate from AWS to Azure
- Azure Blob Storage for Java
- Spring Cloud Azure
- AppCAT Assessment Tool
- Build errors after upgrade: Copy the full Maven error output to Copilot chat and ask for diagnosis — common issues include missing
jakartaimports or incompatible dependency versions - Test failures: Determine if it's a test setup issue (mocking) or an actual app bug — ask Copilot to analyze the failure stack trace
- AWS references remaining: Search the codebase for
aws,s3,AmazonS3— ask Copilot to complete the migration for any remaining references - Docker build failures: Check that the Dockerfile base image matches your Java version (Eclipse Temurin 21) and that the Maven build stage copies the correct JAR
azd upfailures: Verifyaz loginis active, your subscription has Contributor access, andazure.yamlreferences the correct services- Runtime issues: Share stack traces with Copilot for resolution strategies — check
docker-compose logs -ffor local issues
Congratulations! You've completed the Azure Migration & Modernization MicroHack.
What You've Accomplished:
Throughout this MicroHack, you've gained hands-on experience with the complete migration lifecycle:
- Explored a simulated datacenter environment with nested Hyper-V VMs
- Created and configured an Azure Migrate project for discovery
- Downloaded, installed, and configured the Azure Migrate appliance
- Connected the appliance to on-premises infrastructure with proper credentials
- Initiated continuous discovery for performance and dependency data collection
- Reviewed and cleaned migration data using Azure Migrate's Action Center
- Grouped related VMs into logical applications (ContosoUniversity)
- Built business cases showing financial justification with cost savings and ROI analysis
- Analyzed technical assessments for cloud readiness and migration strategies
- Evaluated workload readiness across VMs, databases, and web applications
- Navigated migration data to identify issues, costs, and modernization opportunities
- Cloned and configured the Contoso University .NET application repository
- Used GitHub Copilot App Modernization extension in Visual Studio / VS Code
- Performed comprehensive code assessment for cloud readiness
- Upgraded application from legacy .NET Framework to .NET 9
- Migrated from Windows AD to Microsoft Entra ID authentication
- Resolved cloud readiness issues identified in the upgrade report
- Deployed the modernized application to Azure App Service
- Set up local Java development environment with Docker and Maven
- Ran the Asset Manager application locally to validate functionality
- Used GitHub Copilot App Modernization extension in VS Code
- Performed AppCAT assessment for Azure migration readiness (9 cloud readiness issues, 4 Java upgrade opportunities)
- Executed guided migration tasks to modernize the application
- Migrated from AWS S3 to Azure Blob Storage with automated code refactoring
- Validated migration success through automated CVE, build, consistency, and test validation
- Tested the modernized application locally
Skills Acquired:
- Azure Migrate configuration and management
- Business case development and financial analysis
- AI-powered code modernization with GitHub Copilot
- Migration strategy selection (Rehost, Replatform, Refactor)
- Cloud readiness assessment and remediation
- Azure App Service deployment
- AppCAT assessment for Java applications
- Automated validation and testing workflows
Key Takeaways:
This workshop demonstrated the complete migration lifecycle from discovery to deployment:
- Assessment First: Azure Migrate provides comprehensive discovery and financial justification before migration
- AI-Powered Modernization: GitHub Copilot dramatically accelerates code modernization while maintaining quality
- Platform Migration: Successfully migrated dependencies (S3 to Blob Storage, Windows AD to Entra ID) alongside application code
- Validation at Every Step: Automated testing ensures functionality is preserved throughout modernization
- Multiple Technology Stacks: Experience with both .NET and Java modernization approaches
Continue Your Azure Journey:
- Azure Migrate Documentation - Deep dive into migration tools and strategies
- Azure Well-Architected Framework - Learn enterprise architecture best practices
- GitHub Copilot for Azure - Explore AI-powered development tools
Hands-On Labs:
- Azure Migration Center - Additional migration resources and tools
- Azure Architecture Center - Reference architectures and patterns
- Microsoft Learn - Azure Migration Path - Structured learning modules
Continue Modernization:
- Explore additional migration scenarios in your own environments
- Practice with other workload types (containers, databases, etc.)
- Experiment with GitHub Copilot for other modernization tasks
- Continue with other migration tasks identified in the assessment reports
- Explore containerization options for deploying to AKS or Azure Container Apps
- Implement additional Azure services like Azure Service Bus (replacing RabbitMQ)
- Apply Java runtime upgrades using the identified opportunities
- Configure managed identities for passwordless authentication
If you want to give feedback, please don't hesitate to open an issue on the repository or get in touch with one of us directly.
Thank you for investing the time and see you next time!





























