Question : I am trying to move the resources into cross
subscription but getting this error.
“The move resources request contains KeyVault resources
which are referenced by one of more VMs in the request. This is not supported
currently in cross subscription move. “
Ans: Actually, this is BUG, when normally you migrate
workloads from ASM to ARM portal key vault will get created, and attached to
the VMs, even though you are not using Key Vault or nothing is there in vault,
it is linked to your VMs. Or if you using any key vault, which is not supported
cross subscription movement. But while moving even though you leave key vault
and try to move, it will show same error coz of dependencies.
Solution: Run the below commands @ PowerShell to remove the
linking between your VMs and Key Vault.
$RGName = "Your Resource Group Name"
$vmName = "Your VM Name"
$vm = Get-AzureRmVM -ResourceGroupName
$RGName -Name
$vmName
$vm.OSProfile.Secrets = New-Object -TypeName "System.Collections.Generic.List[Microsoft.Azure.Management.Compute.Models.VaultSecretGroup]"
Update-AzureRmVM -ResourceGroupName $RGName
-VM $vm
Note: You must run above command for each of your VM then
only you can able to Move the resources.
End