This article shows you how to relocate an Azure Storage Account to a new region by creating a copy of your storage account into another region. You also learn how to relocate your data to that account by using AzCopy, or another tool of your choice.
Prerequisites
Ensure that the services and features that your account uses are supported in the target region.
For preview features, ensure that your subscription is allowlisted for the target region.
Depending on your Storage Account deployment, the following dependent resources may need to be deployed and configured in the target region prior to relocation:
Select All resources and then select your storage account.
Select > Automation > Export template.
Choose Download in the Export template blade.
Locate the .zip file that you downloaded from the portal, and unzip that file to a folder of your choice.
This zip file contains the .json files that comprise the template and scripts to deploy the template.
To export a template by using PowerShell:
Sign in to your Azure subscription with the Connect-AzAccount command and follow the on-screen directions:
Azure PowerShell
Connect-AzAccount
If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that you want to move.
In Search the Marketplace, type template deployment, and then press ENTER.
Select Template deployment.
Select Create.
Select Build your own template in the editor.
Select Load file, and then follow the instructions to load the template.json file that you downloaded in the last section.
In the template.json file, name the target storage account by setting the default value of the storage account name. This example sets the default value of the storage account name to mytargetaccount.
To obtain region location codes, see Azure Locations. The code for a region is the region name with no spaces, Central US = centralus.
To deploy the template by using PowerShell:
In the template.json file, name the target storage account by setting the default value of the storage account name. This example sets the default value of the storage account name to mytargetaccount.
Resource group: Select Create new and give the resource group a name.
Location: Select an Azure location.
Select I agree to the terms and conditions stated above, and then select Select Purchase.
Obtain the subscription ID where you want to deploy the target public IP with Get-AzSubscription:
Azure PowerShell
Get-AzSubscription
Use these commands to deploy your template:
Azure PowerShell
$resourceGroupName = Read-Host -Prompt"Enter the Resource Group name"$location = Read-Host -Prompt"Enter the location (i.e. centralus)"New-AzResourceGroup -Name$resourceGroupName -Location"$location"New-AzResourceGroupDeployment -ResourceGroupName$resourceGroupName -TemplateUri"<name of your local template file>"
Prepitné
If you receive an error which states that the XML specified is not syntactically valid, compare the JSON in your template with the schemas described in the Azure Resource Manager documentation.
Configure the new storage account
Some features won't export to a template, so you'll have to add them to the new storage account.
The following table lists these features along with guidance for adding them to your new storage account.
If you set up a CDN for the source storage account, just change the origin of your existing CDN to the primary blob service endpoint (or the primary static website endpoint) of your new account.
Move data to the new storage account
AzCopy is the preferred tool to move your data over due to its performance optimization. With AzCopy, data is copied directly between storage servers, and so it doesn't use the network bandwidth of your computer. You can run AzCopy at the command line or as part of a custom script. For more information, see Copy blobs between Azure storage accounts by using AzCopy.
You can also use Azure Data Factory to move your data over. To learn how to use Data Factory to relocate your data see one of the following guides:
After the deployment, if you want to start over, you can delete the target storage account, and repeat the steps described in the Prepare and Redeploy sections of this article.
To commit the changes and complete the move of a storage account, delete the source storage account.
To remove a storage account by using the Azure portal:
In the Azure portal, expand the menu on the left side to open the menu of services, and choose Storage accounts to display the list of your storage accounts.
Locate the target storage account to delete, and right-click the More button (...) on the right side of the listing.
Select Delete, and confirm.
To remove the resource group and its associated resources, including the new storage account, use the Remove-AzStorageAccount command:
Overview of migration of classic storage accounts to the Azure Resource Manager deployment model. All classic accounts must be migrated by August 31, 2024.
Learn about the different types of storage accounts in Azure Storage. Review account naming, performance tiers, access tiers, redundancy, encryption, endpoints, and more.
Learn how to migrate your classic storage accounts to the Azure Resource Manager deployment model. All classic accounts must be migrated by August 31, 2024.
Introduces how to copy blobs between storage accounts with AzCopy and how to implement the copy operation when network restrictions are set for the storage accounts.