Move Azure resource to new resource group

Hello,

When you are creating new instances for some of the Azure Services, especially in the old portal (https://manage.windowsazure.com/), we are not able to specify resource group. And your new instance ends up in a default resource group.

However, it a lot better if you have all your resources in dedicated resource group so you can easily view and manage them.

With the new Azure Resource Managers PowerShell cmdlets is very easy to move your resources to the correct Azure resource group.

I use a lot Azure Resource Exporer which gives you great overview of all your resources and the associated metadata.

For from Azure Resource Explorer  you can easily find the full id of the resource you want to move. Then you are ready to associate it to the correct resource group with the help of the following PowerShell script

 Login-AzureRmAccount
Set-AzureSubscription -SubscriptionId {Subscription ID}
Move-AzureRmResource -DestinationResourceGroupName {Resource Group Name} -ResourceId {Resource ID} 

The first line authenticates your Azure account. Next you select the correct Azure subscription you want to work with. And the third line is the main one – you are pointing the destination resource group and then you specify the id of the resource you would like to move. The script will ask you to confirm your intention and after a bit you will have your resource in the desired resource group.

Thank you!

 

Kanio

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s