| title | Move regions for resources in Microsoft.Resources |
|---|---|
| description | Show how to move resources that are in the Microsoft.Resources namespace to new regions. |
| ms.topic | how-to |
| ms.date | 02/27/2026 |
You might need to move an existing resource to a new region. This article shows how to move two resource types - templateSpecs and deploymentScripts - that are in the Microsoft.Resources namespace.
If you have a template spec in one region and want to move it to new region, you can export the template spec and redeploy it.
-
Use the command to export an existing template spec. For the parameter values, provide the values that match the template spec you want to export.
For Azure PowerShell, use:
Export-AzTemplateSpec ` -ResourceGroupName demoRG ` -Name demoTemplateSpec ` -Version 1.0 ` -OutputFolder c:\exportFor Azure CLI, use:
az template-specs export \ --resource-group demoRG \ --name demoTemplateSpec \ --version 1.0 \ --output-folder c:\export -
Use the exported template spec to create a new template spec. The following examples show
westusfor the new region but you can provide the region you want.For Azure PowerShell, use:
New-AzTemplateSpec ` -Name movedTemplateSpec ` -Version 1.0 ` -ResourceGroupName newRG ` -Location westus ` -TemplateJsonFile c:\export\1.0.jsonFor Azure CLI, use:
az template-specs create \ --name movedTemplateSpec \ --version "1.0" \ --resource-group newRG \ --location "westus" \ --template-file "c:\export\demoTemplateSpec.json"
-
Select the resource group that contains the deployment script you want to move to a new region.
-
Export the template. When exporting, select the deployment script and any other required resources.
-
Delete the following properties in the exported template:
- tenantId
- principalId
- clientId
-
Find the hardcoded value for the region of the deployment script.
"location": "westus2",
Change the template to allow a parameter for setting the location. For more information, see Set resource location in ARM template.
"location": "[parameters('location')]",
-
Deploy the exported template and specify a new region for the deployment script.
- To learn about moving resources to a new resource group or subscription, see Move resources to a new resource group or subscription.
- To learn about moving resources to a new region, see Move resources across regions.