Troubleshoot issues during automated migration

Applies to: ✔️ Windows VMs ✔️ Linux VMs ✔️ On-premises environment ✔️ Azure Arc-enabled servers

This article describes the errors that might occur when you use migration portal experience or scripts, and how to resolve them.

Required PowerShell modules for executing prerequisite script aren't installed

Cause

When the required PowerShell modules aren't installed for executing the prerequisite scripts, you may see the following errors:

Screenshot that shows the error code when PowerShell modules aren't installed.

Screenshot that shows the error code when the required PowerShell modules aren't installed.

Resolution

Ensure you successfully execute the command Install-Module -Name Az -Repository PSGallery -Force

Unable to acquire token for tenant organizations

Issue

Encountering a warning as - unable to acquire token organizations with error InteractiveBrowserCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCa)

Cause

This is part of one of the documented issues with Az.Accounts 3.0.0 module. Learn more

Resolution

Execute command Update-AzConfig -EnableLoginByWam $false in an elevated PowerShell Session.

Issue

Screenshot that shows the warning message when tokens aren't acquired for tenant organizations.

Cause

Your organization requires to use Connect-AzAccount -Environment AzureChinaCloud with DeviceCode parameter to login to Azure.

Resolution

  • Modify this line in the Prerequisite script where it has the Connect-AzAccount -Environment AzureChinaCloud Command to use the - UseDeviceAuthentication parameter.

Encountering Get-AzOperationInsightsWorkspace exception message

Issue

Screenshot that shows the exception message when the operational insights module isn't installed.

Cause

Operational Insights module isn't installed.

Resolution

Execute Command Install-Module-Name Az.OperationalInsights

Couldn't convert string to DateTimeOffset: 1719675651. Path 'expires_on', line 1, position 1608.

Cause

This error can come up while executing the Migration/Deboarding Runbook in Azure. This can happen if you have custom Az Modules in your automation account, which are outdated.

Resolution

Delete custom Az Modules and ensure that default Az Module is updated to 8.0.0 for PowerShell 5.1

Next steps