Migrate VMs between Azure subscriptions

Azure provide a very poor mechanism to share VM images between subscriptions, while Amazon could easily share images between account.

The following page provide enough PowerShell to automate the whole process, but it can’t work if we have VNet configuration for source VM.

http://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

I revise and add support on VNet configuration, and package scripts to a file.

https://github.com/tombwu/AzureLab/blob/master/CopyVmBetweenSubscriptions.ps1

Just use a command as below, you may migrate VM to another subscription.

.\CopyVmBetweenSubscriptions.ps1 -SourceVmName SrcDevBox -SourceServiceName SrcDevBox -SourceSubscriptionName “Sub1” -TargetServiceName DevBox2 -TargetSubscriptionName “Sub2”

Enjoy it!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s