title | description | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Migrate Automation Account and Resources | Microsoft Docs |
This article describes how to move an Automation Account in Azure Automation and associated resources from one subscription to another. |
automation |
eslesar |
jwhit |
tysonn |
9c2db4a2-f324-48dc-8ce7-3343bf7230d5 |
automation |
na |
article |
na |
infrastructure-services |
09/29/2017 |
magoedte |
For Automation accounts and its associated resources (that is, assets, runbooks, modules, etc.) that you have created in the Azure portal and want to migrate from one resource group to another or from one subscription to another, you can accomplish this easily with the move resources feature available in the Azure portal. However, before proceeding with this action, you should first review the following checklist before moving resources and additionally, the following list specific to Automation.
- The destination subscription/resource group must be in same region as the source. Meaning, Automation accounts cannot be moved across regions.
- When moving resources (e.g. runbooks, jobs, etc.), both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
- Any runbooks or variables, which reference a resource or subscription ID from the existing subscription, should be updated after migration is completed.
Note
This feature does not support moving Classic automation resources.
- From your Automation account, click Move at the top of the page.
- On the Move resources pane, notice it presents resources related to both your Automation account and your resource group(s). Select the subscription and resource group from the drop-down lists, or select the option create a new resource group and enter a new resource group name in the field provided.
- Review and select the checkbox to acknowledge you understand tools and scripts will need to be updated to use new resource IDs after resources have been moved and then click OK.
This action can take several minutes to complete. In Notifications, you are presented with a status of each action that takes place - validation, migration, and then finally when it is completed.
To move existing Automation resources to another resource group or subscription, use the Get-AzureRmResource cmdlet to get the specific Automation account and then Move-AzureRmResource cmdlet to perform the move.
The first example shows how to move an Automation account to a new resource group.
$resource = Get-AzureRmResource -ResourceName "TestAutomationAccount" -ResourceGroupName "ResourceGroup01"
Move-AzureRmResource -ResourceId $resource.ResourceId -DestinationResourceGroupName "NewResourceGroup"
After you execute the above code example, you are prompted to verify you want to perform this action. Once you click Yes and allow the script to proceed, you will not receive any notifications while it's performing the migration.
To move to a new subscription, include a value for the DestinationSubscriptionId parameter.
$resource = Get-AzureRmResource -ResourceName "TestAutomationAccount" -ResourceGroupName "ResourceGroup01"
Move-AzureRmResource -ResourceId $resource.ResourceId -DestinationResourceGroupName "NewResourceGroup" -DestinationSubscriptionId "SubscriptionId"
As with the previous example, you are prompted to confirm the move.
- For more information about moving resources to new resource group or subscription, see Move resources to new resource group or subscription
- For more information about Role-based Access Control in Azure Automation, refer to Role-based access control in Azure Automation.
- To learn about PowerShell cmdlets for managing your subscription, see Using Azure PowerShell with Resource Manager
- To learn about portal features for managing your subscription, see Using the Azure portal to manage resources.