Agentic ModernizationThe repository walkthrough
Field guide

A practical introduction · 14 slides

GitHub Copilot
modernization agent

From understanding legacy code to proving a migration works. One governed workflow, applied to two real applications in this repository.

.NET FrameworkJava / Spring MVCModernize CLI

Practice repository, not a completed migration or a production template.

THE MODERNIZATION LOOP
01

Assess

Understand the current application.

02

Plan

Choose targets and approve the path.

01 / The agent

More than a code-editing conversation.

The Modernize CLI combines deterministic orchestration with Copilot-powered analysis and transformations.

A

Understand

Analyze code, configuration, dependencies, upgrade opportunities, and cloud readiness.

P

Structure

Turn an approved goal into ordered tasks, compatibility decisions, and measurable success criteria.

E

Act

Apply transformations, validate builds, remediate supported findings, and create a traceable change history.

Interactive TUI for guided decisions. Headless CLI for repeatable automation. Reusable skills can encode organizational standards.

02 / This repository

Two stacks. One behavior contract.

Independent blog engines with equivalent publishing, authentication, and moderation workflows.

dotnet/

.NET Framework 4.7.2

  • Classic ASP.NET MVC 5 / Razor.
  • EF6, ASP.NET Identity, and OWIN.
  • Non-SDK project and persistent LocalDB.

Intentionally legacy. Build and run on Windows with Framework MSBuild and IIS Express.

java/

Spring MVC 5

  • Java 11, Spring Security 5, Hibernate 5.
  • JSP views and persistent file-based H2.
  • Maven WAR deployed to Tomcat 9.

Not Spring Boot. Do not introduce it implicitly.

Preserve public routes, drafts, pagination, admin CRUD, CSRF protection, comment approval, original logins, and persistent data.

03 / Control points

Automate the work.
Keep the decisions explicit.

01

Assess

Read the findings. Establish what is obsolete, incompatible, or unknown.

Gate: confirm scope and evidence.

02

Plan

Review target versions, dependency order, data handling, rollback, and tests.

Gate: approve the plan before execution.

The agent can create branches and commits. A successful build is necessary, but is not proof of behavioral or data compatibility.

04 / Get started

One CLI. Your development platform.

Windows · PowerShell

winget install GitHub.Copilot.modernization.agent

Use the documented MSI option if Winget is unavailable.

Linux / macOS · Bash or Zsh

brew tap microsoft/modernize https://github.com/microsoft/modernize-cli
brew install modernize

Requires Homebrew. Other installation options are in the official quickstart.

modernize --version
gh --version
gh auth login

Open a new terminal after installation. Requires Copilot access and GitHub CLI 2.45.0+. Install application toolchains separately; CLI portability does not make .NET Framework cross-platform.

Codespaces is optional: an alternative to local setup with CLI, .NET 10/8, JDK 27 (default) + 11, Maven, PowerShell, and Docker. No apps or assessments auto-start. A Copilot-enabled credential is still required; the legacy .NET baseline still needs Windows. Launch from the README.

05 / Prepare the experiment

One application. One branch. A known baseline.

Before asking the agent to act

  1. Review local changes and create a dedicated branch.
  2. Build and test the original application.
  3. Record the baseline commit and back up data.
  4. Use disposable data for migration experiments.

.NET application · Windows

Set-Location dotnet
# Simple
modernize assess --source . --model auto
# Full analysis
modernize assess --source . --assess-config .\modernize.yaml --model auto

Run one. --source . uses the current folder; full analysis uses the included modernize.yaml.

Java application · Any supported OS

Set-Location java
# Simple
modernize assess --source . --model auto
# Full analysis
modernize assess --source . --assess-config .\modernize.yaml --model auto

Run one. --source . uses the current folder; full analysis uses the included modernize.yaml.

Start one example from the repository root in PowerShell 7. Keep that terminal and application folder for the next three slides.

Without --delegate, the agent runs on your machine, not offline. --model auto picks an available model. AI analysis can use GitHub services and consume Copilot requests.

06 / Assess

Map the risks before changing the code.

Included .NET YAML

analysisCoverage: full
dotnet:
  assessmentDomains: [cloud-readiness, framework-upgrade]
  targetRuntime: net10.0

full: issues + codebase insights. Domains: selected scans. Runtime: comparison target, not upgrade approval. Java's java/modernize.yaml contains only analysisCoverage: full.

Full analysis command

modernize assess --source . --assess-config .\modernize.yaml --model auto

An alternative to the simple command, not an extra required run. Cloud readiness assesses Azure fit; it does not deploy.

Reports: .github/modernize/assessment/. The guide explains fields, Java options, CLI flags, and CI configuration.

Get-ChildItem .\.github\modernize\assessment -Recurse -File -Filter index.html | Sort-Object LastWriteTime -Descending | Select-Object -ExpandProperty FullName
$assessmentReport = Read-Host "Paste the full path of the assessment report file"

In the same PowerShell 7 terminal, paste the full path of the report you reviewed from this run, not the output directory or an older report. The next command passes this file into planning.

07 / Plan

A target version is not a migration plan.

Choose one goal below, then run modernize plan create with the assessment report. Planning is separate from execution.

.NET: decide the migration boundary

$planName = "dotnet-blog-upgrade"
$goal = "Plan only LegacyBlog.sln: compare a Framework upgrade with supported .NET LTS / ASP.NET Core MVC. Preserve routes, data and logins. No Azure or deployment. Stop after planning for approval."

Java: choose a compatible stack

$planName = "java-blog-upgrade"
$goal = "Plan only this Spring MVC app: align JDK, Spring, Security, Hibernate, H2 and Servlet/JSP container. Preserve WAR, routes, data and logins. No Spring Boot, Azure or deployment. Stop after planning for approval."
modernize plan create $goal --plan-name $planName --assess-file-path $assessmentReport --model auto

Stop and inspect .github/modernize/{plan-name}/plan.md and tasks.json. Approve targets, task order, data strategy, rollback, and measurable gates before executing.

08 / Execute and validate

The strongest output is evidence.

After approval, execute in the same terminal and application folder. Inspect all branch changes, then return to the repository root and rerun regression checks.

modernize plan execute --plan-name $planName --model auto
66

.NET assertions

HTTP forms, publication timestamps, comment deletion, and IIS Express / LocalDB restart persistence.

67

Java assertions

Actual Java 11 / Tomcat 9, JSP rendering, correct 405 responses, and container-replacement persistence.

31

Wrapper checks

Offline checks on Windows and Linux, including explicit errors and rejection of linked assessment inputs.

Local verification snapshot: 19 October 2026. Hosted GitHub/Azure DevOps execution, paid live assessments, and native macOS execution remain unverified.

09 / Continuous validation

Two lanes. Different responsibilities.

Explicit opt-in

Modernization assessment

Manual runs, matching main pushes, or Monday 06:00 UTC schedules.

  • Copilot-enabled secret required.
  • Assessment reports as CI artifacts.
  • No plan execution, code upgrades, or deployments.

Automatic runs require MODERNIZATION_ASSESSMENT_ENABLED=true.

pwsh -File scripts/Test-ApplicationBaseline.ps1 -App Java

Local regression example. Java requires Maven, a JDK, and Docker. For .NET on Windows, use -App DotNet; add -Restore when packages need restoring.

10 / Reusable automation

Two CI platforms.
One assessment implementation.

GitHub Actions

.github/workflows/
  modernization-assessment.yml
  modernization-assessment-template.yml

Choose dotnet, java, or all on manual dispatch. Download the run's assessment artifacts.

Azure DevOps

.azdo/
  modernization-assessment.yml
  templates/modernization-assessment.yml

Select the YAML pipeline, provide its secret, and enable the manual run or the automatic opt-in variable.

Both call scripts/Invoke-ModernizationAssessment.ps1. Copy the shared script with the chosen templates when reusing them in another repository.

11 / Security and governance

Make the boundaries visible.

Protect assessment execution

  • Use MODERNIZE_GH_TOKEN; CI job tokens are not Copilot credentials.
  • Do not run credentialed assessments on PR events.
  • Pin the CLI; verify release checksums.
  • Reject linked inputs and stale report directories.
  • Review report access and retention; public artifacts are not confidential storage.

Learn without weakening the apps

Source-only C# and Java exercises demonstrate:

CWE-89 · SQL concatenationCWE-79 · raw HTMLCWE-759 / 328 · MD5

They have no routes or startup registration and are excluded from the assembly and WAR.

Project-only scanners may not inspect excluded files. Select them explicitly for source-review training.

Use synthetic data only. Normal application paths retain ORM/parameterized queries, encoded output, CSRF protection, and framework password hashing.

12 / Demo sequence

Show the process, not just the prompt.

  1. Choose one application; build and test a disposable baseline.
  2. Enter its folder in PowerShell 7 and run modernize assess --source . --model auto.
  3. Review the report and capture its full file path.
  4. Run modernize plan create with the goal, report, and plan name from the workflow slides.
  5. Review compatibility, data, rollback, and tests; stop for approval.
  6. Run modernize plan execute with that plan name, then compare the branch and rerun regressions.

13 / Take it forward

Start small.
Make every change provable.

Establish a baseline, assess one app, approve a bounded plan, and let regression evidence decide when the work is ready to merge.

Apply it to this repository

  • Choose the .NET or Java modernization guide; setup is an optional first step.
  • Require PR validation checks through branch rules.
  • Enable paid assessments only after credential and usage approval.
  • Treat Azure migration as a separate, explicit decision.
Open the repository guide

Official sources

Product capabilities can evolve. Follow the current official documentation and installed CLI help.

Jump to a slide