Επεξεργασία

Κοινή χρήση μέσω


Move an Azure Data Share account to another region using the Azure portal

Azure Data Share accounts can’t be moved from one region to another. You can however, use an Azure Resource Manager template to export the existing Data Share account, modify the parameters to match the destination region, and then deploy the template to the new region. For more information on Resource Manager and templates, see Quickstart: Create and deploy Azure Resource Manager templates by using the Azure portal.

This article will guide you through the process of using a template to export, modify, and deploy an existing Data Share account.

Prerequisites

  • Make sure that the Azure Data Share account is in the Azure region from which you want to move.
  • Azure Data Share accounts can’t be moved between regions. You’ll have to re-add datasets to sent shares and resend invitations to Data Share recipients. For any received shares, you'll need to request that the data provider sends you a new invitation.

Prepare and move

The following steps show how to deploy a new Data Share account using a Resource Manager template via the portal.

Export the template and deploy from the portal

  1. Log in to the Azure portal.

  2. Select All resources and then select your Data Share account

  3. Select Automation > Export template

  4. Choose Deploy in the Export template window.

  5. Select Edit parameters to open the parameters.json file in the online editor.

  6. To edit the parameter of the Data Share account name, change the property under parameters > value from the source Data Share Account's name to the name of the Data Share Account you want to create in a new region, ensure the name is in quotes:

    {
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
    "accounts_my_datashare_account_name": {
       "value": "<target-datashare-account-name>"
        }
       }
    }
    
  7. Select Save in the editor.

  8. Select Edit template to open the template.json file in the online editor.

  9. To edit the target region where the Data Share account will be moved, change the location property under resources in the online editor:

    "resources": [
        {
        "type": "Microsoft.DataShare/accounts",
        "apiVersion": "2021-08-01",
        "name": "[parameters('accounts_my_datashare_account_name')]",
        "location": "<target-region>",
        "identity": {
            "type": "SystemAssigned"
        }
        "properties": {}
        }
    ]
    
  10. To obtain region location codes, see Azure Locations. The code for a region is the region name with no spaces, Central US = centralus.

  11. You can also change other parameters in the template if you choose. This is optional depending on your requirements:

    • Sent Shares - You can edit which Sent Shares are deployed into the target Data Share Account by adding or removing Shares from the resources section in the template.json file:
    "resources": [
        {
        "type": "Microsoft.DataShare/accounts/shares",
        "apiVersion": "2021-08-01",
        "name": "[concat(parameters('accounts_my_datashare_account_name'), '/test_sent_share')]",
        "dependsOn": [
            "[resourceId('Microsoft.DataShare/accounts', parameters('accounts_my_datashare_account_name'))]"
        ],
        "properties": {
            "shareKind": "CopyBased"
        }
        },
    ]
    
    • Sent Share Invitations - You can edit which Invitations are deployed into the target Data Share account by adding or removing Invitations from the resources section in the template.json file.
    "resources": [
        {
         "type": "Microsoft.DataShare/accounts/shares/invitations",
         "apiVersion": "2021-08-01",
         "name": "[concat(parameters('accounts_my_datashare_account_name'), '/test_sent_share/blob_snapshot_jsmith_microsoft_com')]",
         "dependsOn": [
             "[resourceId('Microsoft.DataShare/accounts/shares', parameters('accounts_my_datashare_account_name'), 'test_sent_share')]",
             "[resourceId('Microsoft.DataShare/accounts', parameters('accounts_my_datashare_account_name'))]"
         ],
        "properties": {
            "targetEmail": "jsmith@microsoft.com"
        }
        }
    ]
    
    • Datasets - You can edit which datasets are deployed into the target Data Share account by adding or removing datasets from the resources section in the template.json file. Below is an example of a BlobFolder dataset.

    • If you're also moving the resources contained in the datasets to a new region, you'll have to remove the datasets from the template.json file and manually readd them once the Data Share account and resources referenced in the datasets are moved to the new region.

    Important

    "resources": [
        {
        "type": "Microsoft.DataShare/accounts/shares/dataSets",
        "apiVersion": "2021-08-01",
        "name": "[concat(parameters('accounts_my_datashare_account_name'), '/blobpath/directory')]",
        "dependsOn": [
            "[resourceId('Microsoft.DataShare/accounts/shares', parameters('accounts_my_datashare_account_name'), 'blobpath')]",
            "[resourceId('Microsoft.DataShare/accounts', parameters('accounts_my_datashare_account_name'))]"
             ],
            "kind": "BlobFolder",
            "properties": {
                "containerName": "<container-name>",
                "prefix": "<prefix>"
                "subscriptionId": "<subscription-id>",
                "resourceGroup": "<resource-group-name>",
                "storageAccountName": "<storage-account-name>"
            }
        }
    ]
    
  12. Select Save in the online editor.

  13. Under the Project details section, select the Subscription dropdown to choose the subscription where the target Data Share account will be deployed.

  14. Select the Resource group dropdown to choose the resource group where the target Data Share account will be deployed. You can select Create new to create a new resource group for the target Data Share account.

  15. Verify that the Location field is set to the target location you want the Data Share account to be deployed to.

  16. Verify under Instance details that the name matches the name that you entered in the parameters editor above.

  17. Select Review + Create to advance to the next page.

  18. Review the terms and select Create to begin the deployment.

  19. Once the deployment finishes, go to the newly created Data Share account.

  20. If you were unable to transfer datasets using the template, you'll need to readd datasets to all of your Sent Shares.

  21. Resend invitations to all recipients of your sent shares and alert the consumers of your shares that they'll need to reaccept and remap the data you're sharing with them.

Verify

Sent shares

  • Confirm that all sent shares in your source Data Share account are now present in the target Data Share account.
  • For each sent share, confirm that all data sets from the source share are now present in the target share. If they aren't, you'll need to manually readd them.
  • For all share subscriptions in each sent share in your source account, confirm that you have sent invitations to all recipients of the shares so that they'll be able to access the data again.

Received shares

  • Confirm that you have requested new invitations from data providers for all received shares from your source data share account.
  • Once you receive these invitations, you'll need to remap the data sets and run snapshots to access the data again.

Clean up source resources

To complete the move of the Data Share account, delete the source Data Share account. To do so, select the resource group from your dashboard in the Azure portal, navigate to the Data Share account you wish to delete and select Delete at the top of the page.

Next steps

In this tutorial, you moved an Azure Data Share account from one region to another and cleaned up the source resources. To learn more about moving resources between regions and disaster recovery in Azure, refer to: