Move an Azure virtual machine between subscriptions or data centers / geos

I couldn't find this on the web, but found the link internally, so I'm hoping the title here and web search algorithms enable others to find it.  I had to move a VM between subscriptions and geos and it worked like a champ.  Some notes:

  • Pay attention to the comments in the article.  A trick to deal with changing locations is to just create a VM - even if you delete it later - so you can grab the right geo in your storage container.  I set mine to "US East" for example.
  • Also, note the comment that you have to change your working directory from the default c:\ to something you can actually write to.
  • During the copy, the % complete doesn't work properly.  I saw someone say this in the article comments as well.  It will climb, but the % complete is incorrect and can be ignored.
  • I also had to change the Get-AzureSubscription -Current | Set-AzureSubscription -CurrentStorageAccountName $destStorageName line to Set-AzureSubscription -CurrentStorageAccountName $destStorageName -SubscriptionName "Visual Studio Ultimate with MSDN" .
  • When it was done, I then had to set up RDP like this:  https://blogs.msdn.com/b/mast/archive/2014/03/06/enable-rdp-or-reset-password-with-the-vm-agent.aspx

Here's the article:  https://blogs.msdn.com/b/microsoft_press/archive/2014/01/29/from-the-mvps-copying-a-virtual-machine-from-one-windows-azure-subscription-to-another-with-powershell.aspx