Udostępnij za pośrednictwem


Recovering Synapse Analytics workspace after transferring a subscription to a different Microsoft Entra directory (tenant)

W tym artykule opisano sposób odzyskiwania obszaru roboczego usługi Synapse Analytics po przeniesieniu subskrypcji do innego katalogu Microsoft Entra. The Synapse Analytics workspace will not be accessible after transferring a subscription to a different Microsoft Entra directory (tenant).

Podczas próby uruchomienia programu Synapse Studio po przeniesieniu zostanie wyświetlony błąd: "Nie można załadować co najmniej jednego zasobu z powodu braku dostępu, kod błędu 403".

Screenshot of Synapse Studio Error 403 after tenant migration.

Wykonaj kroki opisane w tym artykule po przeniesieniu subskrypcji między najemcami, aby odzyskać środowisko pracy Synapse Analytics.

Przeniesienie subskrypcji do innego katalogu Microsoft Entra (tenant) to złożony proces, który musi być starannie zaplanowany i wykonany. Azure Synapse Analytics require security principals (identities) to operate normally. When a subscription is moved to a different tenant, all principal IDs change, role assignments are deleted from Azure resource, and system assigned managed identities are dropped.

To understand the impact of transferring a subscription to another tenant see Transfer an Azure subscription to a different Microsoft Entra directory

This article covers the steps involved in recovering a Synapse Analytics workspace after moving the subscription across tenants.

Wymagania wstępne

  • To know more about service or resources impacted by tenant move see Transfer an Azure subscription to a different Microsoft Entra directory.
  • Save all the role assignment for Microsoft Entra users, groups, and managed identities. Te informacje mogą służyć do przypisywania wymaganych uprawnień do zasobów platformy Azure, takich jak Azure Synapse Analytics i ADLS Gen2 po przeniesieniu dzierżawy. Zobacz Krok 1: Przygotowanie do transferu
  • Zapisz wszystkie uprawnienia niezbędne dla użytkowników firmy Microsoft Entra w dedykowanej i bezserwerowej puli SQL. Microsoft Entra users will be deleted from the dedicated and serverless SQL pools after tenant move.

Kroki odzyskiwania obszaru roboczego usługi Synapse Analytics

Po przeniesieniu subskrypcji do innej dzierżawy wykonaj poniższe kroki, aby odzyskać obszar roboczy usługi Azure Synapse Analytics.

  1. Wyłącz i ponownie włącz zarządzaną tożsamość przypisaną przez system. Więcej informacji znajduje się w dalszej części tego artykułu.
  2. Przypisz uprawnienia kontroli dostępu opartej na rolach platformy Azure użytkownikom, grupom i tożsamościom zarządzanym w Microsoft Entra w obszarze roboczym usługi Synapse Analytics oraz wymaganym zasobom platformy Azure.
  3. Ustaw administratora usługi SQL Active Directory.
  4. Re-create Microsoft Entra users and groups based on their equivalent users and groups in the new Microsoft Entra tenant for the dedicated and serverless SQL pools.
  5. Assign Azure RBAC to Microsoft Entra users, groups to Synapse Analytics workspace. Ten krok powinien być pierwszym krokiem po odzyskaniu obszaru roboczego. Without this step, launching Synapse Studio will throw 403 messages, due to Microsoft Entra users not having permissions on the workspace:
    {"error":{"code":"Unauthorized","message":"The principal '<subscriptionid>' does not    have the required Synapse RBAC permission to perform this action. Required permission:    Action: Microsoft.Synapse/workspaces/read, Scope: workspaces/tenantmove-ws-1/*."}}
    
  6. Assign Azure RBAC roles to Microsoft Entra users, groups, service principals to all the resources used in the workspace artifacts, such as ADLS Gen2. Aby uzyskać więcej informacji na temat kontroli dostępu opartej na rolach platformy Azure w usłudze ADLS Gen2, zobacz Kontrola dostępu oparta na rolach (Azure RBAC).
  7. Add Synapse RBAC role assignments to Microsoft Entra users and groups. For more information, see How to manage Synapse RBAC role assignments in Synapse Studio
  8. Recreate all the Microsoft Entra logins and users in dedicated and serverless SQL pool. Aby uzyskać więcej informacji, zobacz Uwierzytelnianie SQL w usłudze Azure Synapse Analytics.
  9. Utwórz ponownie wszystkie tożsamości zarządzane przypisane przez użytkowników i przypisz te tożsamości do obszaru roboczego usługi Synapse Analytics. Aby uzyskać więcej informacji, zobacz Poświadczenia w usłudze Azure Data Factory i usłudze Azure Synapse

Uwaga

Ensure the following steps are executed only after confirming subscription is successfully moved to another tenant.

Wyłączanie i ponowne włączanie przypisanej przez system tożsamości zarządzanej dla obszaru roboczego usługi Synapse Analytics

W tej sekcji pokazano, jak używać interfejsu wiersza polecenia platformy Azure lub programu Azure PowerShell do wyłączania i ponownego włączania przypisanej przez system tożsamości zarządzanej dla obszaru roboczego usługi Azure Synapse Analytics. Rozważ następujące kroki w interfejsie wiersza polecenia platformy Azure lub w programie Azure PowerShell.

$resourceGroupName="Provide the Resource group name"
$workspaceName="Provide the workspace name"
$subscriptionId="Provide the subscription Id"

$url = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Synapse/workspaces/$workspaceName\?api-version=2021-06-01"

W następnym przykładzie wyłączono tożsamość zarządzaną przypisaną przez system dla obszaru roboczego.

az rest --method patch --headers  Content-Type=application/json   `
--url  $url `
--body '{ \"identity\":{\"type\":\"None\"}}'

Workspace provisioningState should be Succeeded and the identity type should None after preceding command is executed. If you execute the following command, provisioningState value might be shown as Provisioning and will take few minutes to change the status to Succeeded. Value of the provisioningState should be Succeeded before re-enabling the System Assigned Managed Identity for the workspace.

Aby sprawdzić status obszaru roboczego, uzyskać stan przygotowania i typ tożsamości, użyj poniższego fragmentu kodu:

az rest --method GET --uri $uri

Wynikowy kod JSON powinien być podobny do następującego:

   {
  "id": "/subscriptions/<subscriptionid>/resourceGroups/TenantMove-RG/providers/Microsoft Synapse/workspaces/tenantmove-ws",
  "identity": {
    "type": "None"
  },
  "location": "eastus",
  "name": "tenantmove-ws",
  "properties": {
    "connectivityEndpoints": {
      "dev": "https://tenantmove-ws.dev.azuresynapse.net",
      "sql": "tenantmove-ws.sql.azuresynapse.net",
      "sqlOnDemand": "tenantmove-ws-ondemand.sql.azuresynapse.net",
      "web": "https://web.azuresynapse.net?workspace=%2fsubscriptions%2<subscriptionid>b%2fresourceGroups%2fTenantMove-RG%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2ftenantmove-ws"
    },
    "cspWorkspaceAdminProperties": {
      "initialWorkspaceAdminObjectId": "<object id>"
    },
    "defaultDataLakeStorage": {
      "accountUrl": "https://tenantmovedemowsstorage.dfs.core.windows.net",
      "filesystem": "demo",
      "resourceId": "/subscriptions/<subscriptionid>/resourceGroups/TenantMove-RG/providers/Microsoft.Storage/storageAccounts/tenantmovedemowsstorage"
    },
    "encryption": {
      "doubleEncryptionEnabled": false
    },
    "extraProperties": {
      "WorkspaceType": "Normal"
    },
    "managedResourceGroupName": "tenantmove-ws-managed-rg",
    "privateEndpointConnections": [],
    "provisioningState": "Succeeded",
    "publicNetworkAccess": "Enabled",
    "sqlAdministratorLogin": "sqladminuser",
    "trustedServiceBypassEnabled": false,
    "workspaceUID": "<workspace UID>"
  },
  "resourceGroup": "TenantMove-RG",
  "tags": {},
  "type": "Microsoft.Synapse/workspaces"
}

Następne polecenie ponownie włączy tożsamość zarządzaną przypisaną przez system dla obszaru roboczego:

az rest --method patch --headers  Content-Type=application/json   `
--url  $url `
--body '{ \"identity\":{\"type\":\"SystemAssigned\"}}'

Następne polecenie wyświetli status obszaru roboczego. The provisioningState value should be Succeeded. The provisioningState value will change from Provisioning to Succeeded. Identity type will be changed to SystemAssigned.

az rest --method GET --uri $uri

Następne kroki