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.
- Check if the source subscription can participate in a cross-subscription move. Use the following operation:
In the request body, include:POST https://management.azure.com/subscriptions/{sourceSubscriptionId}/providers/Microsoft.ClassicCompute/validateSubscriptionMoveAvailability?api-version=2016-04-01
{ "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.
Run the validation REST API in the Postman. The source subscription passed the validation and showed “Available”.
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.
- Check if the destination subscription can participate in a cross-subscription move. Use the following operation:
In the request body, include:POST https://management.azure.com/subscriptions/{destinationSubscriptionId}/providers/Microsoft.ClassicCompute/validateSubscriptionMoveAvailability?api-version=2016-04-01
{ "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”.
- 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.
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.
After some time, the classic cloud service in the source subscription is not available anymore.
Then the migrated classic cloud service is available now in the target subscription.
More Information
The domain name and the public IP are still the same as before, for normal case, there should not be downtime for the cloud service during the migration.
Reference documents Move Azure Classic deployment resources | Microsoft Docs
Posted at https://sl.advdat.com/3jiNBpOhttps://sl.advdat.com/3jiNBpO