Azure: How to move resources between subscriptions under different tenants?
When living with Azure Cloud platform, you might sometimes be required to move resources from one subscription to another one. There might be several reasons why to do that.
For example, you have started with a cloud project in some subscription, because you didn't want to wait for somebody to decide the right destination subscription.
In this case, you would typically deploy the application to the right subscription.
But sometimes this is not easy and might be more difficult than you think. Imagine, you have a lot of devices out there, which points to some of your resources. For example, some smartphone app is using some REST endpoint of your service (trivial case).
You might ask yourself, why this might be the problem? In the past, we were using Azure Classic resources (before ARM time). At that time support, guys were able to move your resources from subscription 1 to subscription.
Since ARM has been introduced, moving of resources has a huge limitation. It means you cannot move resources from S1 to S2 if subscriptions are under different AAD tenants. That means support cannot do this for you too.
This article describes how you can do this with few tweaks. Assume we have two subscriptions S1 and S3. S1 is your source subscription under tenant T1 and S3 is the destination subscription S3 under tenant T2. Don’t be confused with indexing S1-T1 and S2-T2.
First of all, you have to create a new temporary PAY-AS-YOU-GO subscription S2. It is up to you how to do that. But note you have to first login to the portal as the owner of subscription S1, which is under tenant T1. Subscription S2 must be created within tenant T1. When you log to the portal into S1 and create a new subscription, this will be automatically done for you.
The following picture shows all three subscriptions with resource group RG1, which we want to move from S1-T1 to S3-T2.
Once you have a new subscription you will be able to move resources from S1 to newly created subscription S2. This is possible because both are under same tenant T1. The following picture shows how to do that.
As next, you have to change the directory of subscription S2 from tenant T1 to tenant T2. Note a single subscription in Azure is associated with the single tenant only. One tenant can be associated with many subscriptions.
If you did all correctly, your new temporary subscription S2 is under tenant T2. If you log in now to the portal as the owner of subscription S3, you will see in there resource group RG1. Click on remove. Note there is no picture for this step included, but it is semantically same as the second picture. Now you will be able to move RG1 from S2 to S3. However, note that after you have connected S2 to tenant T2, you will have to wait possibly for one hour for AAD sync up. That means if you try to move RG1 from S2 to S3 immediately after assigning S2 to T2, moving process will fail. Don’t get in a panic just wait one hour or longer.
Last but not least, thank José Maria Soares from Microsoft who helped to work out this scenario.