Azure PowerShell Migration Module

Overview

The Azure PowerShell Migration Module provides a set of cmdlets to help you transition resources and configurations from older Azure PowerShell versions to the latest Az module. It automates common migration tasks, validates compatibility, and offers remediation guidance.

Description
Features

This module is designed for administrators, DevOps engineers, and developers who need to upgrade scripts and automation pipelines without service interruption.

  • Automated cmdlet mapping from AzureRM to Az
  • Resource compatibility checks
  • Bulk migration support for ARM templates
  • Detailed migration reports
  • Rollback capabilities

Prerequisites

Installation

Install the migration module from the PowerShell Gallery:

Install-Module -Name Az.Migration -Repository PSGallery -Scope CurrentUser

After installation, import the module:

Import-Module Az.Migration

Cmdlet Reference

Cmdlet Description
Start-AzMigration Initiates a migration session for a given scope.
Get-AzMigrationReport Retrieves the detailed migration report.
Invoke-AzMigrationRemediation Applies suggested remediation steps.
Export-AzMigrationTemplate Exports an ARM template compatible with the Az module.
Reset-AzMigrationSession Rolls back a migration session to its original state.

Examples

1. Migrate a Resource Group

# Start migration
$session = Start-AzMigration -ResourceGroupName "MyRG"

# Review the report
Get-AzMigrationReport -SessionId $session.Id

# Apply remediation
Invoke-AzMigrationRemediation -SessionId $session.Id

2. Export a Migration‑Ready Template

Export-AzMigrationTemplate -ResourceGroupName "MyRG" -OutputPath "C:\Templates\MyRG-Az.json"

Migration Guide

  1. Assess: Run Start-AzMigration with the -WhatIf flag to see potential changes.
  2. Plan: Review the generated Get-AzMigrationReport for compatibility issues.
  3. Execute: Apply remediation with Invoke-AzMigrationRemediation.
  4. Validate: Test the migrated scripts in a non‑production environment.
  5. Rollback (if needed): Use Reset-AzMigrationSession to revert changes.

Additional Resources