How To Migrate Cloud Services (Classic) Across Subscriptions
Published Apr 07 2022 01:43 AM 3,042 Views
Microsoft

Sometimes users need to migrate classic cloud services to different subscriptions for better resources management. This blog will introduce the details and constraints of classic cloud service migration across subscriptions.

 

Constraints

When moving classic cloud services to a new subscription, the following restrictions apply:

  • The source and target subscriptions need to be under the same tenant.
  • The CSP subscriptions do not support migrating classic cloud services.
  • All classic resources in the source subscription must be moved in the same operation.
  • The target subscription must not have any other classic resources.
  • The move can only be requested through a separate REST API for classic moves. The standard Resource Manager move commands don't work when moving classic resources to a new subscription.

 

Migration Steps

 

To move classic cloud services to a new subscription, use the REST operations to check the subscriptions validation and realize the migration.

 

  1. Check if the source subscription can participate in a cross-subscription move. Use the following operation:
    POST https://management.azure.com/subscriptions/{sourceSubscriptionId}/providers/Microsoft.ClassicCompute/validateSubscriptionMoveAvailability?api-version=2016-04-01​
    In the request body, include:
    {
     "role": "source"
    }​

    The response for the validation operation is in the following format:

    {
     "status": "{status}",
     "reasons": [
       "reason1",
       "reason2"
     ]
    }


Example:

Subscription A is the source one and it owned the classic cloud service “yitest” with publc IP 20.xx.xx.161.

yiyang2_2-1649315810033.png

Run the validation REST API in the Postman. The source subscription passed the validation and showed “Available”.

yiyang2_3-1649315810044.png

Possible Error Message in the Source Subscription Validation Stage:

 

  • "Subscription migration for Subscriptionld {subscription ID} cannot continue as IAAS Classic to ARM migration is in progress for the following Deployment resource: xx in HostedService {classic cloud service name}”

    This message means that there is a classic cloud service that is ongoing migrating to the cloud service (extended support). Users can abort this migration to ARM operation and then validate again.

  • “Source subscription {subscription ID} is empty.”

    The source subscription cannot be empty, disabled or deleted or current undergoing migration. During the migration period, write operations are not allowed on resources within the subscription.

  • “Source subscription contains application(s) which doesn't support migration: {application name}
    “Source subscription contains following cloud service(s) which doesn't support migration: {cloud service name}”

    The resources mentioned in the error message cannot be migrated, so users need to delete these resources before triggering the migration.

 

  1. Check if the destination subscription can participate in a cross-subscription move. Use the following operation:
    POST https://management.azure.com/subscriptions/{destinationSubscriptionId}/providers/Microsoft.ClassicCompute/validateSubscriptionMoveAvailability?api-version=2016-04-01​
    In the request body, include:
    {
     "role": "target"
    }​

    The response is in the same format as the source subscription validation.


    Example:

    Subscription B is the target one and it does not have any classic resources. Run the REST API in the Postman. The target subscription passed the validation and showed “Available”.

    yiyang2_1-1649321535857.png

     

 

  1. If both subscriptions pass validation, use the following operation to migrate the classic cloud service across two subscriptions.
    POST https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.ClassicCompute/moveSubscriptionResources?api-version=2016-04-01​

    In the request body, include:

    {
     "target": "/subscriptions/{target-subscription-id}"
    }


Example:

Run the above REST API in the Postman and there should be no response after running It.

yiyang2_6-1649315810065.png

After sending this REST API request, the classic cloud service in the source subscription is shown below. Some information is hidden, such as site URL and public IP.

yiyang2_7-1649315810116.png

After some time, the classic cloud service in the source subscription is not available anymore.

yiyang2_8-1649315810118.png

Then the migrated classic cloud service is available now in the target subscription.

yiyang2_9-1649315810211.png

 

 

More Information

The domain name and the public IP are still the same as before, for normal cases, there should not be downtime for the cloud service during the migration.

 

Reference documents Move Azure Classic deployment resources | Microsoft Docs

 

 

 

Co-Authors
Version history
Last update:
‎Apr 07 2022 06:49 PM
Updated by: