Uwaga
Dostęp do tej strony wymaga autoryzacji. Może spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
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.
Wymagania wstępne
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:
Przestój
Aby zrozumieć możliwe przestoje, zobacz Cloud Adoption Framework for Azure: Select a relocation method (Przewodnik Cloud Adoption Framework dla platformy Azure: wybieranie metody relokacji).
Przygotuj się
To prepare, you must export and then modify a Resource Manager template.
Export a template
A Resource Manager template contains settings that describe your storage account.
To export a template by using Azure portal:
Zaloguj się do witryny Azure Portal.
Wybierz pozycję Wszystkie zasoby, a następnie wybierz konto magazynowe.
Wybierz >Automation> i Szablon eksportu.
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.
Modyfikowanie szablonu
Modify the template by changing the storage account name and region.
To deploy the template by using Azure portal:
W witrynie Azure Portal wybierz polecenie Utwórz zasób.
In Search the Marketplace, type template deployment, and then press ENTER.
Wybierz pozycję Wdrożenie szablonu.
Wybierz Utwórz.
Wybierz pozycję Utwórz własny szablon w edytorze.
Wybierz pozycję Załaduj plik, a następnie postępuj zgodnie z instrukcjami, aby załadować plik template.json pobrany w ostatniej sekcji.
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
."$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "storageAccounts_mysourceaccount_name": { "defaultValue": "mytargetaccount", "type": "String" } },
Edit the location property in the template.json file to the target region. This example sets the target region to
centralus
."resources": [ { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-04-01", "name": "[parameters('storageAccounts_mysourceaccount_name')]", "location": "centralus" } ]
Aby uzyskać kody lokalizacji regionów, zobacz Lokalizacje platformy Azure. Kod regionu to nazwa regionu bez spacji, Centralny USA = centralus.
Redeploy
Deploy the template to create a new storage account in the target region.
Save the template.json file.
Enter or select the property values:
- Subskrypcja: wybierz subskrypcję platformy Azure.
- 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.
Tip
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.
Funkcja | Wskazówki |
---|---|
Lifecycle management policies | Manage the Azure Blob storage lifecycle |
Static websites | Hostowanie statycznej witryny internetowej w usłudze Azure Storage |
Event subscriptions | Reagowanie na zdarzenia usługi Blob Storage |
Alerty | Tworzenie i wyświetlanie alertów dziennika aktywności oraz zarządzanie nimi za pomocą usługi Azure Monitor |
Content Delivery Network (CDN) | Use Azure CDN to access blobs with custom domains over HTTPS |
Uwaga
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:
- Copy data to or from Azure Blob storage by using Azure Data Factory
- Copy data to or from Azure Data Lake Storage Gen2 using Azure Data Factory
- Copy data from or to Azure Files by using Azure Data Factory
- Copy data to and from Azure Table storage by using Azure Data Factory
Odrzucanie lub czyszczenie
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.
Następne kroki
Aby dowiedzieć się więcej na temat przenoszenia zasobów między regionami i odzyskiwaniem po awarii na platformie Azure, zobacz: