Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Move your Azure resources in CLI instead of using the portal

  • April 21, 2022
  • 3 min read
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.


A great feature in Azure is the possibility to move resources to:

– Another resource group

– Another subscription

– Another region

The list of resources that you can move is available here: Move operation support by resource type – Azure Resource Manager | Microsoft Docs

In this example, I will move a MySQL Database Server from a subscription A to a subscription B. By the portal, it is easy, but it can take a long time to do the validation and the move:

Move resources

After waiting each time the long validation period, I find another way to do not wait so many time: with CLI.

The first command to execute to validate that we can do the move is az resource invoke-action. Let’s do this for our resource:

If the answer is empty, you are good to go to move the resource. Otherwise, you will have the error, for example, if you use Private Endpoint, you will not be able to move your resource:Private Endpoint

Private Endpoint 2

In my case I can move the resource. I will use the az resource move command to do the job:

After few minutes, we can see that the resource moved to the other subscription:The resource moved to the other subscription

The resource moved to the other subscription 2

Resource group

Like this it is very simple to automate the move of resources to another resource group/subscription/region. The only limitation is that not all resources can move at this time.

Found Florent’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!