schudel
schudel

Reputation: 1225

Move V2 (ARM) virtual machines between azure subscriptions

I'm trying to move a virtual machine (ARM) between subscriptions.

With V1 machines the process was straight forward.

I have tried to create a new ARM virtual machine and replace the vhd file, but this does not work as the vhd blob has a lease even when the machine is shut down.

Is there a way using PowerShell to achieve this?

Upvotes: 1

Views: 527

Answers (1)

Michael B
Michael B

Reputation: 12228

This should work -

Set-AzureRmVMOSDisk -VM $vm -Name "test" -VhdUri $uri -CreateOption attach -Windows 

Wrapped into the rest of a VM Create script

Upvotes: 1

Related Questions