Moving Resources Between Subscriptions
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks and see fewer ads — read each lesson on a single page with Pro
Lesson: Moving Resources Between Subscriptions in Microsoft Azure
Introduction: The Necessity of Resource Mobility
In the lifecycle of a cloud-based organization, change is the only constant. As businesses grow, merge, or reorganize their internal departments, the initial structure of their Azure environment often becomes outdated. You might have started with a single subscription for testing, only to find that your production workloads have outgrown it, or perhaps you need to move resources to a different billing entity to satisfy internal cost-allocation requirements. Moving resources between subscriptions is a critical administrative task that allows you to maintain clean architecture, optimize costs, and align your technical infrastructure with your business hierarchy.
Understanding how to move resources is not just about knowing which button to click in the portal; it is about understanding the dependencies, the limitations, and the governance implications of these moves. When a resource moves from one subscription to another, it carries its own history and configuration, but it must now abide by the policies, access controls, and billing logic of its new home. This lesson will guide you through the technical requirements, the step-by-step process, and the strategic considerations needed to perform these operations safely and without disrupting your operations.
Understanding the Scope of Resource Moves
Before diving into the "how," it is vital to understand the "what" and "where." In Azure, a subscription is not just a container for resources; it is a boundary for billing, access control (IAM), and policy enforcement. When you move a resource, you are effectively changing the context in which that resource operates.
Not all resources can be moved. Some services have hard dependencies on their original subscription or region that make them ineligible for migration. Before you attempt a move, you must verify that the resource type is supported. Azure provides a list of resources that support the move operation, and this list is updated periodically as the platform evolves. If you attempt to move an unsupported resource, the Azure Resource Manager (ARM) will simply return an error, preventing you from proceeding.
The Architectural Prerequisites
To successfully migrate resources, both the source and the destination subscriptions must reside within the same Microsoft Entra ID (formerly Azure Active Directory) tenant. If you need to move resources between different tenants, the process is significantly more complex and requires a different set of procedures, often involving a "lift and shift" approach where you recreate the resources in the target tenant. For the purpose of this lesson, we are focusing on moves within the same tenant, which is the standard administrative task for resource reorganization.
Callout: Tenant vs. Subscription It is common for newcomers to confuse tenants and subscriptions. Think of the Microsoft Entra ID tenant as your organization's identity boundary. All subscriptions belonging to your company exist under this single identity umbrella. Moving between subscriptions is an administrative shift within your company; moving between tenants is a cross-organizational migration.
Preparing for the Move: Pre-Flight Checks
Performing a move without preparation is a recipe for downtime. Azure provides a "Validate Move" operation that you should always run before executing the actual transition. This operation checks for dependencies and ensures that the target subscription is capable of housing the resources you intend to move.
Key Considerations Before Moving
- Dependent Resources: Many resources are linked. For example, a Virtual Machine (VM) is linked to a Virtual Network (VNet), a Network Interface (NIC), and often a Public IP address. If you move the VM but not its network components, the operation may fail or leave the VM in a broken state.
- Access Control (RBAC): Permissions are not moved with the resource. If you move a resource, any Role-Based Access Control (RBAC) assignments applied directly to that resource will remain, but the inheritance from the source subscription will be lost. You must re-apply permissions in the destination subscription.
- Policy Compliance: Azure Policies are often applied at the subscription level. A resource that was compliant in the source subscription might trigger a policy violation in the destination subscription if the destination has different governance rules.
- Billing and Cost Management: Once the move is completed, the resource will be billed to the destination subscription from that point forward. Ensure that the budget owners for both subscriptions are aware of this change to avoid surprises in monthly reporting.
Step-by-Step: Moving Resources via the Azure Portal
The Azure Portal is the most accessible way to move resources, especially for smaller batches. Follow these steps to ensure a smooth transition:
- Navigate to the Resource: Go to the Azure portal and locate the resource or resource group you wish to move.
- Select the Move Option: Within the resource overview page, look for the "Move" command in the top menu bar. You can choose to move to another resource group or another subscription.
- Select Destination: Choose the target subscription and the target resource group. If the resource group does not exist, you can create a new one during this step.
- Validate: Click the "Validate" button. Azure will run a background job to check if the move is allowed. This step is non-negotiable; do not skip it.
- Execute: If the validation passes, click "Move." The portal will display a notification indicating that the move is in progress.
Note: The portal may show that the move is "succeeded" quickly, but the background process might take longer depending on the number of resources. Monitor the "Activity Log" to ensure all dependent resources were moved successfully.
Moving Resources via Azure CLI
For automation and bulk operations, the Azure CLI is superior to the portal. It allows you to script the move process, which is essential for large-scale reorganizations. The primary command used for this is az resource move.
Example: Moving a Resource Group
If you want to move an entire resource group—which is often the cleanest way to manage moves—you can use the following command structure:
# First, identify the resource IDs
source_rg_id=$(az group show --name "SourceRG" --query id --output tsv)
target_sub_id="/subscriptions/YOUR-TARGET-SUBSCRIPTION-ID"
# Execute the move command
az resource move \
--destination-group "TargetRG" \
--destination-subscription-id $target_sub_id \
--ids $source_rg_id
Explanation of the Script
--destination-group: Specifies the name of the resource group in the target subscription where the resources will land.--destination-subscription-id: The unique ID of the target subscription.--ids: The full resource ID of the item being moved. You can provide multiple IDs in a space-separated list if you are moving several resources at once.
Tip: When moving via CLI, always use the
--queryparameter to verify the resource IDs before passing them to themovecommand. This prevents accidental selection of the wrong resources.
Handling Common Pitfalls and Limitations
Even with careful planning, errors occur. Understanding these pitfalls allows you to troubleshoot effectively.
1. The "Hard-Coded" Dependency Trap
Some resources have internal dependencies that are not immediately obvious. For instance, if you have a Key Vault, moving it can be problematic if other services rely on its specific URL for secrets. If you move a Key Vault, you may need to update the connection strings in your applications, as the resource ID (which often contains the subscription ID) might change.
2. Managed Identities
If your resources use System-Assigned Managed Identities, these are tied to the resource itself, but the identity's role assignments are tied to the subscription. When you move the resource, the identity remains, but you will likely need to re-assign the necessary RBAC roles in the new subscription so the identity can continue to access other resources (like Key Vaults or Storage Accounts).
3. Azure Backup and Site Recovery
Resources protected by Azure Backup or Site Recovery often cannot be moved while they are in a protected state. You must disable the backup, move the resource, and then re-enable the backup in the new subscription. Failing to do this will result in a validation error.
4. Locked Resources
If you have applied a "CanNotDelete" or "ReadOnly" lock on a resource or a resource group, the move operation will fail. You must remove the locks before attempting the move and then re-apply them in the destination.
| Feature | Can it be moved? | Notes |
|---|---|---|
| Virtual Machines | Yes | Ensure NICs and VNets are moved together. |
| Storage Accounts | Yes | Check for dependencies like private endpoints. |
| Key Vaults | Yes | Requires re-configuration of access policies. |
| Azure SQL | Yes | Requires careful handling of firewall rules. |
| Backup/Recovery | No | Must disable protection before moving. |
Governance Best Practices
Moving resources is an act of governance. It should not be done haphazardly. To maintain a healthy Azure environment, follow these industry-standard practices:
Implement a Tagging Strategy
Before moving any resource, ensure it is properly tagged. Use tags to identify the "owner," "cost center," and "environment" (e.g., prod, dev, test). When you move a resource, these tags travel with it, which makes it much easier to track costs and ownership in the new subscription.
Use Resource Groups as Boundaries
Organize your resources into logical groups based on their lifecycle. If you have a web application, keep the App Service, the Database, and the Storage Account in the same resource group. Moving an entire resource group is significantly safer and easier than moving individual components, as it preserves the logical relationship between them.
Audit the Move
After the move is complete, use the Azure Activity Log to audit the operation. Check for any warnings or errors that occurred during the finalization of the move. Additionally, verify that all RBAC assignments have been correctly replicated in the destination subscription.
Warning: Never move resources during peak business hours. Even though the move operation is designed to be non-disruptive, the reconfiguration of network paths and identity permissions can occasionally cause transient connectivity issues. Always perform these operations during a defined maintenance window.
Comparing Move Methods
When deciding how to move your resources, consider the scale of your operation.
- Azure Portal: Best for single, ad-hoc moves. It provides a visual interface and validation checks that are easy to understand for beginners.
- Azure CLI / PowerShell: Best for bulk operations and repeatable processes. If you are reorganizing an entire department's infrastructure, scripting the move ensures consistency and reduces human error.
- Azure Resource Graph: Use this to query your environment before the move to identify all resources that need to be moved. It is an excellent tool for mapping dependencies across your entire tenant.
Advanced Scenario: Moving Across Regions
Sometimes, a "move" is not just between subscriptions, but also between regions. Note that the native Move command in Azure only supports moving within the same subscription or between subscriptions in the same region. If you need to move a resource to a different region, you are essentially performing a migration.
For cross-region moves, you must use the Azure Resource Mover service. This tool is designed specifically for this purpose and manages the dependencies, the replication of data, and the final cutover process. While this falls outside the scope of a simple subscription-to-subscription move, it is important to know that the standard Move command will not suffice for cross-region scenarios.
Troubleshooting Common Errors
When a move operation fails, the error message provided by ARM is usually quite descriptive. Here are the most common error types:
"Resource Move is not supported for this resource type"
This occurs when you try to move a resource that has a hard dependency on the current subscription or a specific region-locked service. Check the Microsoft documentation for the latest "Move operations" support matrix.
"The resource is currently locked"
As mentioned earlier, verify that there are no Management Locks on the resource or its parent resource group. Use the following CLI command to check for locks:
az lock list --resource-group "YourRG"
"The target subscription is not in the same tenant"
If you receive this, you are likely trying to move a resource to a subscription that is associated with a different Entra ID tenant. You cannot perform this move natively. You will need to export the resource template (ARM template), delete the original, and recreate it in the new tenant.
Maintaining Security Posture Post-Move
Once the resources are settled in their new subscription, your work is not finished. You must conduct a "Post-Move Security Review."
- Re-verify RBAC: Ensure that the correct users and groups have access to the resources. Sometimes, the "Inherited" permissions from the old subscription are not what you want in the new one.
- Check Network Security Groups (NSGs): If the resource was moved to a new VNet, the NSG rules might be different. Ensure that the traffic flow is still restricted as required by your security policy.
- Update Monitoring and Alerting: If you have alerts configured based on the subscription ID, these will break. Update your Azure Monitor alerts to point to the new subscription.
- Cost Analysis: Within 24 hours of the move, check the Cost Management portal to ensure that the resources are being reported under the correct billing subscription.
The Importance of Documentation
In a large organization, "who moved this and why?" is a common question. Every move should be documented in your internal knowledge base or as part of your Infrastructure-as-Code (IaC) repository. If you use Bicep or Terraform to manage your Azure environment, you should update your code to reflect the new subscription structure. Failing to keep your code in sync with the actual state of your Azure environment leads to "configuration drift," where your deployment scripts no longer match the reality of your infrastructure.
Key Takeaways
- Plan and Validate: Always run the "Validate" operation before moving resources. It is the best way to catch dependency issues early and avoid failed operations.
- Group logically: Move resources in logical units (Resource Groups) rather than individual items. This maintains the integrity of the application architecture.
- Permissions are not moved: Remember that RBAC roles and permissions do not follow the resource. You must manually re-assign these in the destination subscription.
- Check for Locks: Management locks are a frequent cause of failed moves. Always check for and remove these before starting the process.
- Use Automation for Scale: If you are moving more than a handful of resources, use the Azure CLI or PowerShell. It is faster, more reliable, and creates an audit trail of the commands executed.
- Post-Move Review is Critical: A move is not complete until you have verified security, networking, and billing in the new subscription. Never assume it was successful just because the portal said "Move succeeded."
- Keep IaC Updated: If you use Infrastructure-as-Code, ensure your templates are updated to reflect the new subscription hierarchy to prevent configuration drift.
By following these principles, you turn a potentially high-risk administrative task into a routine maintenance procedure. Resource mobility is a powerful tool for maintaining an agile cloud environment, provided it is managed with the precision and foresight that modern governance requires.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons