Skip to content
Azure Lessons
Azure Lessons
  • Home
  • AWS
  • Azure VM
  • Azure AD
  • Azure tutorial
    • Azure Cognitive Services
    • Azure Machine Learning
    • Azure DevOps
    • Azure PowerShell Commands

How to change Azure Storage Account location

September 26, 2023September 14, 2023 by Rajkishore

In this Azure article, we will discuss how to change the location or region of your Azure Storage account.

Table of Contents

  • How to change Azure Storage Account location
    • Approach-1: Using Azure Portal
    • Approach-2: Using PowerShell
  • Wrapping Up

How to change Azure Storage Account location

Basically, if you wish to change the location of your Azure Storage account, what you need to do is, you will have to create a copy of the storage account in the target location or region then you need to transfer or move all the data from the source storage account to the target storage account.

You can do this using Azure Portal and by using PowerShell.

Approach-1: Using Azure Portal

The first step is to export the Azure Storage account as a template using the below steps.

  1. Log in to the Azure Portal.
  2. Navigate to your Azure Storage account.
  3. Click on the Export template link from the left navigation that is present under the Automation tab as shown below.
change Azure Storage Account location

4. Click on the Download option to download the template.

update Azure Storage Account location

5. Now, it will get downloaded as a zip folder like below.

Modify Azure Storage Account location

6. You can unzip the folder and keep it.

Now let’s modify the existing template

We will change the storage account name and location using the below steps

  1. Click on the Create a Resource button.
How to update Azure Storage Account location

2. Search for the template deployment and click on the search result “Template deployment”.

How to modify Azure Storage Account location

3. Click on the Create button.

how to move azure storage account to another location

4. On the Custom deployment window, click on the Build your own template in the editor link as shown below.

how to move azure storage account to another region

5. Click on the Load file button. Select the template.json file that we downloaded and unzipped earlier.

how to move azure storage account to a different location

6. Modify the storage account name and the location.

how to move azure storage account to a different region

7. Click on the Save button to save the changes.

8. On the Custom deployment window, Provide the below details

  • Subscription: Select the subscription that you wish to use here.
  • Resource Group: You can select an existing Resource Group or you can click on the Create new link and provide a name to create a new Resource Group.
  • Region: Select the required region or location.

Finally, click on the Review + Create button as highlighted below.

move storage account to another region

After clicking on the Review + Create button, It will Start validating all the entries entered by you. For me, it throws an error as the name of the storage account “mytargetstorageaccount” that I have entered was not available so I changed the storage account name from “mytargetstorageaccount” to “mytargetstorageaccountg” and the Resource Group name also changed from “demo357” to “demo589”.

move storage account to another region

Now, the validation is successful and you will see the Create button on the successful validation. Finally, click on the Create button on the next screen as shown below.

how to move data from one storage account to another in azure

Now, the Storage account has been created successfully. You can check out the below screenshot.

move storage account to another region

Approach-2: Using PowerShell

You can also use the below steps to change Azure Storage Account location using PowerShell.

  1. Execute the below PowerShell command to export the storage account as a template.
$myctx = Get-AzSubscription -SubscriptionId 1cdf4300-dee5-4518-9c9c-feaa72a5cbd1
Set-AzContext $myctx
$myresource = Get-AzResource -ResourceGroupName DEMORG2 -ResourceName demoggh -ResourceType Microsoft.Storage/storageAccounts
Export-AzResourceGroup -ResourceGroupName DEMORG2 -Resource $myresource.ResourceId

Note: Make sure to change the Resource Group and storage account name as per yours.

After executing the above script, I got the JSON file saved on the below path.

Export-AzResourceGroup

2. You can open the template.json file and modify the storage account name and location as we had done in step 6 above.

3. Now, run the below PowerShell script to create a new storage account in your target region.

$myrsgName = "Demo12346"
$region = "centralus"

New-AzResourceGroup -Name $myrsgName -Location "$region"
New-AzResourceGroupDeployment -ResourceGroupName $myrsgName -TemplateUri "DEMORG2.json"  

Note: Make sure to change the Resource Group and region as per yours. Enter the storage account name if it will prompt you to enter.

After executing the above script, I got the below-expected output and the storage account was created successfully.

azure move storage account to another region

The storage account has been created successfully. Check out the below screenshot.

move storage account to another region

You may also like following the below articles

  • How to find Azure Storage Account Name
  • How to enable Azure Storage Account Public Access

Wrapping Up

In this Azure article, we discussed how to change Azure Storage Account location using Azure Portal and PowerShell. Thanks for reading this article !!!

Set-AzStorageAccount
New-AzStorageContext

Follow Us

Follow us on Twitter Subscribe us on Youtube

Recent Posts

  • What Is Azure App Service
  • Azure Web App vs App Service
  • Get-AzADAppCredential
  • Install Azure CLI on Linux
  • Install Azure CLI Ubuntu
  • About
  • Contact
  • Privacy Policy
  • Sitemap
© 2023 Azure Lessons