Blog Post

Apps on Azure Blog
2 MIN READ

Modernizing Applications by Migrating Code to Use Managed Identity with Copilot App Modernization

ayangupta's avatar
ayangupta
Icon for Microsoft rankMicrosoft
Jan 19, 2026

Migrating application code to use Managed Identity removes hard‑coded secrets, reduces operational risk, and aligns with modern cloud security practices. Applications authenticate directly with Azure services without storing credentials. GitHub Copilot app modernization streamlines this transition by identifying credential usage patterns, updating code, and aligning dependencies for Managed Identity flows.

Supported Migration Steps

GitHub Copilot app modernization helps accelerate:

  • Replacing credential‑based authentication with Managed Identity authentication.
  • Updating SDK usage to token‑based flows.
  • Refactoring helper classes that build credential objects.
  • Surfacing libraries or APIs that require alternative authentication approaches.
  • Preparing build configuration changes needed for managed identity integration.

Migration Analysis

Open the project in Visual Studio Code or IntelliJ IDEA. GitHub Copilot app modernization analyzes:

  • Locations where secrets, usernames, passwords, or connection strings are referenced.
  • Service clients using credential constructors or static credential factories.
  • Environment‑variable‑based authentication workarounds.
  • Dependencies and SDK versions required for Managed Identity authentication.

The analysis outlines upgrade blockers and the required changes for cloud‑native authentication.

Migration Plan Generation

GitHub Copilot app modernization produces a migration plan containing:

  • Replacement of hard‑coded credentials with Managed Identity authentication patterns.
  • Version updates for Azure libraries aligning with Managed Identity support.
  • Adjustments to application configuration to remove unnecessary secrets.

Developers can review and adjust before applying.

Automated Transformations

GitHub Copilot app modernization applies changes:

  • Rewrites code that initializes clients using username/password or connection strings.
  • Introduces Managed Identity‑friendly constructors and token credential patterns.
  • Updates imports, method signatures, and helper utilities.
  • Cleans up configuration files referencing outdated credential flows.

Build & Fix Iteration

The tool rebuilds the project, identifies issues, and applies targeted fixes:

  • Compilation errors from removed credential classes.
  • Incorrect parameter types or constructors.
  • Dependencies requiring updates for Managed Identity compatibility.

Security & Behavior Checks

GitHub Copilot app modernization validates:

  • CVEs introduced through dependency updates.
  • Behavior changes caused by new authentication flows.
  • Optional fixes for dependency vulnerabilities.

Expected Output

A migrated codebase using Managed Identity:

  • Updated authentication logic.
  • Removed credential references.
  • Updated SDKs and dependencies.
  • A summary file listing code edits, dependency changes, and items requiring manual review.

Developer Responsibilities

Developers should:

  • Validate identity access on Azure resources.
  • Reconfigure role assignments for system‑assigned or user‑assigned managed identities.
  • Test functional behavior across environments.
  • Review integration points dependent on identity scopes and permissions.

Learn full upgrade workflows in the Microsoft Learn guide for upgrading Java projects with GitHub Copilot app modernization.

Learn more

Predefined tasks for GitHub Copilot app modernization

Apply a predefined task

Install GitHub Copilot app modernization for VS Code and IntelliJ IDEA

 

Updated Jan 19, 2026
Version 2.0
No CommentsBe the first to comment