Azure Arc, is a powerful extension of the Azure platform, it enables organisations to manage and govern their resources across across multi-cloud and on-premises environments.
One of the fundamental challenges that cloud administrators often face is optimising resource management within their Azure environments. There may come a time when you need to reorganise or restructure your resources, such as relocating an Azure Arc-enabled server to a different resource group or subscription.
In this blog, we'll embark on a journey through the process of moving an Azure Arc-enabled server to a different resource group or subscription
Move an Azure Arc-enabled server to a different resource group or subscription
To move an Azure Arc-enabled server to a different resource group you can use the Azure PowerShell module and the Move-AzResource cmdlet.
The Move-AzResource cmdlet allows you to move resources to another resource group. The destination resource group can be in another subscription.
Let’s look at the PowerShell commands you need to use to move an Arc-enabled server to a different resource group.
The first command gets the information relating to the resource you want to move and the second command moves the resource.
# Get Azure Arc-enabled Server you want to move
$Resource = Get-AzResource -ResourceType "microsoft.hybridcompute/machines" -ResourceName "resource-name"
# Move the Azure Arc-enabled server to a new resource group
Move-AzResource -ResourceId $Resource.ResourceId -DestinationResourceGroupName "resource-group-name"
The resource groups need to be within the same Azure region, if you need to move your Azure Arc-enabled servers to another region, you should follow the instructions here.
As cloud administrators grapple with the ever-present challenge of optimizing resource management in Azure, the need for flexibility and adaptability becomes increasingly clear. The Move-AzResource cmdlet can be used to help adapt to your needs.