Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get Move-AzureResource working

I'm trying to move some of my resources (Azure Web Apps, Azure SQLs, Redis caches) from one resource group to another. I'm using the Azure Resource Manager PowerShell cmdlets.

Here's what I've tried:

PS C:\> Move-AzureResource -DestinationResourceGroupName NewResourceGroup -ResourceId "/subscriptions/someguid/resourceGroups/Default-Web-WestEurope/providers/Microsoft.Web/sites/somesite"

Or:

PS C:\> Get-AzureResource -ResourceName somesite | Move-AzureResource -DestinationResourceGroupName NewResourceGroup

Or: just Move-AzureResource, hitting enter and supplying the parameters one by one.

None of the commands seems to work. They just don't do anything. No error, no output. When I changed the debug preference to $DebugPreference = "Continue" I got only the following:

DEBUG: 12:16:06 - MoveAzureResourceCommand begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 12:16:06 - using account id '[email protected]'...

Please note that I'm able to create a new resource group (New-AzureResourceGroup), list resource groups (Get-AzureResourceGroup), list resources (Get-AzureResource), etc.

Note: you have to call Switch-AzureMode AzureResourceManager before you can use the cmdlets. The authentication is done by Add-AzureAccount.

Articles I've been referring to:

  • Moving resources between Azure Resource Groups
  • Move-AzureResource
  • Using Azure PowerShell with Azure Resource Manager
  • GitHub - Using Azure PowerShell with Azure Resource Manager
like image 534
rocky Avatar asked May 08 '15 12:05

rocky


1 Answers

Reading this azure forum it looks like they have implemented the cmdlet but not all resources support being moved yet.

We have released a new powershell cmdlet to move resources across resource groups. Not all resources have support yet, but the "main" ones do like hosted services, virtual machines & storage accounts.

Looking back at the example I was following, this does only use VM's. So based on this I think websites aren't supported yet. That fact that no error or warning is returned for unsupported resources is a bit poor.

like image 70
Youngs Avatar answered Sep 19 '22 08:09

Youngs