Migrate Compute Resources

This section provides information that you may find helpful as you migrate your Azure compute resources from one Azure region to another.

Virtual Machine

Now all China Azure regions are same geographic cluster supported by Azure Site Recoverty (See geographic cluster).

See Move Azure VMs to another regionto migrate VMs.

Cloud Services

Cloud Services can’t be migrated from one Azure region to another. You can redeploy Azure Cloud Services resources by providing the .cspkg and .cscfg definitions again.

Azure portal

To redeploy cloud services in the Azure portal:

  1. Create a new cloud service by using your .cspkg and .cscfg definitions.
  2. Update the CNAME or A record to point traffic to the new cloud service.
  3. When traffic points to the new cloud service, delete the old cloud service in the source region.

PowerShell

To redeploy cloud services by using PowerShell:

  1. Create a new cloud service by using your .cspkg and .cscfg definitions.
    New-AzureService -ServiceName <yourServiceName> -Label <MyTestService> -Location <targetRegion>  
    
  2. Create a new deployment by using your .cspkg and .cscfg definitions.
    New-AzureDeployment -ServiceName <yourServiceName> -Slot <Production> -Package <YourCspkgFile.cspkg> -Configuration <YourConfigFile.cscfg>  
    
  3. Update the CNAME or A record to point traffic to the new cloud service.
  4. When traffic points to the new cloud service, delete the old cloud service in the source Azure region.
    Remove-AzureService -ServiceName <yourOldServiceName>
    

REST API

To redeploy cloud services by using the REST API:

  1. Create a new cloud service in the target environment.
    https://management.core.windows.net/<subscription-id>/services/hostedservices  
    
  2. Create a new deployment by using the Create Deployment API. To find your .cspkg and .cscfg definitions, you can call the Get Package API.
    https://management.core.windows.net/<subscription-id>/services/hostedservices/<cloudservice-name>/deploymentslots/production  
    
  3. When traffic points to the new cloud service, delete the old cloud service in the source Azure region.

For more information:

Service Fabric

To migrate Azure Service Fabric resources from one Azure region to another, you need to create and redeploy the Service Fabric cluster and application resources in the new region. Data must be backed up and restored from old to new cluster for stateful services.

  1. Create a new cluster in a resource group in the target Azure region using the Azure portal or Resource Manager resources using guidelines recommended in the Production readiness checklist.

  2. No new calls should show up and no services should talk to each other or do work.

  3. If it’s a stateful service, then there’s a requirement to move data from the old cluster to the new cluster. See, Backup data from the old cluster to learn how to move data from the old cluster to the new one.

  4. If it’s a stateless service, then there’s no requirement to move data but you must move the traffic.

  5. Update the application configuration to be deployed to a the new region.

  6. Deploy an application to the new region using Resource Manager resources.

  7. For stateful services, you’ll need to restore the data using a backup taken in step #3 above.

  8. Update the traffic manager service (Azure Traffic Manager) to route active traffic to the target region. Gradually move the application traffic to the new region.

  9. Verify the application is deployed to the target Azure region and accepting traffic.

  10. Validate there’s no traffic flowing to the source Azure region.

  11. Delete the cluster by cleaning resource group associated with the cluster in the source Azure region.

References:

For more information:

Batch

You can’t automatically migrate your Azure Batch account and data from one region to another. Instead, to migrate you’ll need to complete the following steps:

  1. Create a Batch account in the target region. Make sure there are storage accounts in the target region(s) or create them there.
  2. Deploy your workloads to the new Batch account and start running the jobs there.

For more information:

Virtual machine scale sets

To migrate virtual machine scale sets across Azure regions, export the Resource Manager template, adapt it to the new environment, and then redeploy to the target region. Export only the base template and redeploy the template in the new environment. Individual virtual machine scale set instances should all be the same. Before starting the redeployment, ensure dependencies on other resources are understood and migrated to the target region.

IMPORTANT:
Change location, Key Vault secrets, certificates, and other GUIDs to be consistent with the new region.

For more information:

Azure Functions

See Functions chapter of Migrate IoT resources.