共用方式為


使用 Azure Data Share 來與 Azure 資料總管共用資料

有許多傳統方式可以共用資料,例如透過檔案共用、FTP、電子郵件和 API。 這些方法需要雙方建置和維護資料管線,以在小組和組織之間移動資料。 透過 Azure Data Explorer,您可以輕鬆地安全地與公司或外部合作夥伴中的人員共用您的資料。 共用會以近乎即時的方式發生,不需要建置或維護資料管線。 提供者端的所有資料庫變更,包括架構和資料,都可立即在取用者端取得。

Azure Friday Video。

Azure Data Explorer分離儲存體和計算,可讓客戶在相同的基礎儲存體上執行多個計算 (唯讀) 實例。 您可以將資料庫附加為 後續資料庫,這是遠端叢集上的唯讀資料庫。

設定資料共用

使用Azure Data Share來傳送和管理整個公司或外部合作夥伴和客戶的邀請和管理共用。 Azure Data Share會使用追蹤資料庫,在提供者和取用者的 Azure Data Explorer 叢集之間建立符號連結。 此選項可讓您使用單一窗格來檢視和管理 Azure Data Explorer 叢集和其他資料服務的所有資料共用。 Azure Data Share也可讓您在不同Microsoft Entra租使用者中跨組織共用資料。

注意

這兩個叢集上的管理員都可以使用各種 API 直接設定追蹤資料庫。 這在您需要額外計算以向外延展以進行報告的情況下很有用。

您可以設定下列專案的資料共用:

注意

建立共用關聯性時,Azure Data Share會在提供者和取用者的 Azure Data Explorer 叢集之間建立符號連結。 如果資料提供者撤銷存取權,則會刪除符號連結,而共用資料庫 () 不再可供資料取用者使用。

Azure Data Explorer資料共用。

資料提供者可以在資料庫層級或叢集層級共用資料。 共用資料庫的叢集是領導者叢集,而接收共用的叢集是追蹤者叢集。 追蹤者叢集可以遵循一或多個領導者叢集資料庫。 追蹤程式叢集會定期同步處理,以檢查變更。 領導者和追蹤者之間的延遲時間會根據中繼資料和資料的整體大小而有所不同,從幾秒鐘到幾分鐘。 資料會在取用者叢集上快取,而且僅適用于讀取或查詢作業,但有例外狀況可覆寫經常性快取原則和資料庫許可權。 在追蹤者叢集上執行的查詢會使用本機快取,而且不會使用領導者叢集的資源。

必要條件

  • Azure 訂用帳戶。 建立 Azure 免費帳戶
  • 適用于領導者和追蹤者的 Azure Data Explorer 叢集和資料庫。 建立叢集和資料庫
  • 領導者資料庫應該包含資料。 您可以使用擷取概觀中所討論的其中一種方法來擷取資料

資料共用流程

  1. 提供者會使用其 Azure Data Share 資源來共用完整資料庫或特定資料表,並指定接收者的電子郵件地址。
  2. Azure Data Share傳送電子郵件邀請給接收者。
  3. 接收者會開啟電子郵件邀請,並選取其 Azure Data Share資源。
  4. 接收者會使用 Azure Data Share,將共用資料庫或資料表對應至適當的叢集。

資料提供者 - 共用資料

資料提供者可以與接收者共用完整資料庫或特定資料表。

共用完整資料庫

請遵循影片中的指示來建立 Azure Data Share 帳戶、新增資料集,以及傳送邀請。 資料提供者 - 共用資料。

共用資料表

您可以使用Azure Resource Manager 範本,透過 Azure Data Share共用一或多個資料表。

使用下列步驟共用資料表:

  1. 建立範本,並在資料集、資料表限制上設定適當的參數,並指定邀請收件者。 使用下表中的資訊可協助您設定範本。

    參數 描述 範例
    accountName 提供者的 Azure Data Share 帳戶名稱。
    位置 所有資源的位置。 領導者和追蹤者必須位於相同的位置。
    shareName 將在資料共用帳戶上建立的共用名稱稱。
    recipientEmail Azure Data Share接收者的電子郵件。
    databaseName 提供者的資料庫名稱。
    databaseResourceId 提供者資料庫的資源識別碼。
    externalTablesToExclude 要排除的外部資料表清單。 若要排除所有外部資料表,請使用 [「*」]。 ["ExternalTable1ToExclude", "ExternalTable2ToExclude"]
    externalTablesToInclude 要包含的外部資料表清單。 若要包含以 'Logs' 開頭的所有外部資料表,請使用 [「Logs*」]。 ["ExternalTable1ToInclude", "ExternalTable2ToInclude"]
    materializedViewsToExclude 要排除的具體化檢視清單。 若要排除所有具體化檢視,請使用 [「*」]。 ["Mv11ToExclude", "Mv22ToExclude"]
    materializedViewsToInclude 要包含的具體化檢視清單。 若要包含以 'Logs' 開頭的所有具體化檢視,請使用 [「Logs*」]。 ["Mv1ToInclude", "Mv2ToInclude"]
    tablesToExclude 要排除的資料表清單。 若要排除所有資料表,請使用 [「*」]。 ["table1ToExclude", "table2ToExclude"]
    tablesToInclude 要包含的資料表清單。 若要包含所有資料表,請使用 [「*」]。 ["table1ToInclude", "table2ToInclude"]
    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "accountName": { "type": "String" },
        "location": { "defaultValue": "[resourceGroup().location]", "type": "String" },
        "shareName": { "type": "String" },
        "recipientEmail": { "type": "String" },
        "databaseName": { "type": "String" },
        "databaseResourceId": { "type": "String" },
        "externalTablesToExclude": { "type": "Array" },
        "externalTablesToInclude": { "type": "Array" },
        "materializedViewsToExclude": { "type": "Array" },
        "materializedViewsToInclude": { "type": "Array" },
        "tablesToExclude": { "type": "Array" },
        "tablesToInclude": { "type": "Array" }
      },
      "variables": {
        "invitationSuffix": "[replace(replace(parameters('recipientEmail'),'@', '_'), '.', '_')]"
      },
      "resources": [
        {
          "type": "Microsoft.DataShare/accounts",
          "apiVersion": "2021-08-01",
          "name": "[parameters('accountName')]",
          "location": "[parameters('location')]",
          "identity": {
            "type": "SystemAssigned"
          },
          "properties": {}
        },
        {
          "type": "Microsoft.DataShare/accounts/shares",
          "apiVersion": "2021-08-01",
          "name": "[concat(parameters('accountName'), '/' , parameters('shareName'))]",
          "dependsOn": [
            "[resourceId('Microsoft.DataShare/accounts', parameters('accountName'))]"
          ],
          "properties": {
            "shareKind": "InPlace"
          }
        },
        {
          "type": "Microsoft.DataShare/accounts/shares/invitations",
          "apiVersion": "2021-08-01",
          "name": "[concat(parameters('accountName'), '/',  parameters('shareName'), '/', concat(parameters('shareName'), variables('invitationSuffix')))]",
          "dependsOn": [
            "[resourceId('Microsoft.DataShare/accounts/shares', parameters('accountName'), parameters('shareName'))]",
            "[resourceId('Microsoft.DataShare/accounts', parameters('accountName'))]"
          ],
          "properties": {
            "targetEmail": "[parameters('recipientEmail')]"
          }
        },
        {
          "type": "Microsoft.DataShare/accounts/shares/dataSets",
          "apiVersion": "2021-08-01",
          "name": "[concat(parameters('accountName'), '/', parameters('shareName'), '/', parameters('databaseName'))]",
          "dependsOn": [
            "[resourceId('Microsoft.DataShare/accounts/shares', parameters('accountName'), parameters('shareName'))]",
            "[resourceId('Microsoft.DataShare/accounts', parameters('accountName'))]"
          ],
          "kind": "KustoTable",
          "properties": {
            "kustoDatabaseResourceId": "[parameters('databaseResourceId')]",
            "tableLevelSharingProperties": {
              "externalTablesToExclude": "[parameters('externalTablesToExclude')]",
              "externalTablesToInclude": "[parameters('externalTablesToInclude')]",
              "materializedViewsToExclude": "[parameters('materializedViewsToExclude')]",
              "materializedViewsToInclude": "[parameters('materializedViewsToInclude')]",
              "tablesToExclude": "[parameters('tablesToExclude')]",
              "tablesToInclude": "[parameters('tablesToInclude')]"
            }
          }
        }
      ]
    }
    
  2. 使用 Azure 入口網站 或 PowerShell 部署 Azure Resource Manager範本。

    範本部署。

資料取用者 - 接收資料

請遵循影片中的指示來接受邀請、建立資料共用帳戶,以及對應至取用者叢集。

資料取用者 - 接收資料。

資料取用者現在可以移至其 Azure Data Explorer 叢集,將使用者權限授與共用資料庫並存取資料。 使用已排入佇列擷取至來源 Azure Data Explorer叢集的資料,會在幾秒鐘到幾分鐘內顯示在目標叢集上。

限制