Move an Azure load testing resource to another region

This article describes how to move your Azure load testing resource to another Azure region. You might want to move your resource for a number of reasons. For example, to take advantage of a new Azure region, to generate load from a different location, to meet internal policy and governance requirements, or in response to capacity planning requirements.

Azure load testing resources are region-specific and can't be moved across regions automatically. When you recreate the Azure load testing resource in the target Azure region, you need to recreate existing load tests in the new resource.

Go through the following steps to move your resource to another region:

  1. Export the configuration of your Azure load testing resource in an Azure Resource Manager template (ARM template).

  2. Optionally, download any test artifacts from existing load tests.

  3. Create a new Azure load testing resource in the target region by using the ARM template.

  4. Recreate the load tests in the new resource.

  5. Optionally, delete the Azure load testing resource in the previous region.

Prerequisites

Prepare

To get started, export the ARM template for the Azure load testing resource and download the input artifacts for existing load tests. Later, you'll update the ARM template to deploy the resource in the target Azure region.

  1. Export the ARM template that contains settings and information for your Azure Load Testing resource by following the steps mentioned here.

    Screenshot that shows the ARM template to export an Azure load testing resource in the Azure portal.

  2. Download the input artifacts for each existing test in the resource:

    1. Navigate to the Tests section for the load testing resource.

    2. Select the test name to go to the list of test runs.

    3. Select the ellipsis (...) for a test run, and then select Download input file.

      The browser should now start downloading a zipped folder that contains all input files for the test, such as the test configuration YAML file, the JMeter script, and any configuration or data files.

      Screenshot that shows how to download input files for a test.

Note

If you are using an Azure Key Vault to configure secrets for your load test, you can continue to use the same Key Vault.

Move

To move the resource to the target Azure region, modify the ARM template, create a new resource by using the template, and recreate the load tests in the new resource.

Move the resource

  1. In the Azure portal, select Create a resource.

  2. In the Marketplace, search for template deployment. Select Template deployment (deploy using custom templates), and then select Create.

    Screenshot that shows the Template deployment option in the Azure Marketplace, highlighting the Create button.

  3. Select Build your own template in the editor.

  4. Select Load file, and then select the template.json file that you exported previously.

  5. Update the JSON contents:

    1. Update the name of the target Azure load testing resource by updating the defaultValue property.

      {
          "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
              "loadtest_name": {
                  "defaultValue": "{new-resource-name}",
                  "type": "String"
              }
          },
      
    2. Edit the location property to use your target region. The following example sets the target region to eastus.

      "resources": [
              {
                  "type": "Microsoft.LoadTestService/loadtests",
                  "apiVersion": "2021-12-01-preview",
                  "name": "[parameters('loadtest_name')]",
                  "location": "eastus",
      

      To obtain region location codes, see Azure Locations. The code for a region is the region name with no spaces. For example, East US = eastus.

  6. Select Save.

  7. Enter the Subscription and Resource group for the target resource.

  8. Select Review and create, then select Create to create a new Azure load testing resource in the target Azure region.

Create tests

After creating the Azure load testing resource, you can recreate the load tests in the Azure portal.

Refer to the test configuration in the config.yaml files you downloaded earlier for configuring the load test settings. Upload the Apache JMeter script and optional configuration files from the downloaded input artifacts.

If you invoke the load tests in a CI/CD workflow, update the loadTestResource parameter in the CI/CD pipeline definition to match the new Azure load testing resource name.

Note

If you have configured any of your load tests with secrets or certificates from Azure Key Vault, make sure to grant the new resource access to the Key Vault.

Clean up source resources

After the move is complete, delete the Azure load testing resource from the source region. You pay for resources, even when you're not using them.

  1. In the Azure portal, search and select Azure Load Testing.

  2. Select your Azure load testing resource.

  3. On the resource Overview page, select Delete, and then confirm.

Caution

When you delete an Azure load testing resource, you can no longer view the associated test runs and test results.

Next steps