APIを使用してAzure Blob StorageをExperience Platformに接続する

このガイドでは、Flow Service APIを使用してAzure Blobg Storage アカウントをAdobe Experience Platformに接続する方法について説明します。

はじめに

このガイドは、Adobe Experience Platform の次のコンポーネントを実際に利用および理解しているユーザーを対象としています。

  • ​ ソース ​: Experience Platformを使用すると、様々なソースからデータを取り込むことができますが、Experience Platform サービスを使用して着信データを構造化、ラベル付け、強化することができます。
  • ​ サンドボックス ​: Experience Platformは、1つのExperience Platform インスタンスを個別のバーチャル環境に分割して、デジタルエクスペリエンスアプリケーションの開発と進化に役立つバーチャルサンドボックスを提供します。

Experience Platform APIの使用

Experience Platform APIの呼び出しを正常に行う方法について詳しくは、Experience Platform APIの概要に関するガイドを参照してください。

必要な資格情報の収集

認証について詳しくは、Azure Blob Storage 概要を参照してください。

Azure Blob Storage アカウントをExperience Platformに接続する connect

Azure Blob Storage アカウントをExperience Platformに接続する方法について詳しくは、以下の手順を参照してください。

ベース接続の作成

NOTE
作成したら、Azure Blob Storage ベース接続の認証タイプを変更することはできません。 認証タイプを変更するには、新しいベース接続を作成する必要があります。

ベース接続は、認証の詳細、接続ステータス、一意のIDを保存して、ソースをExperience Platformにリンクします。 このIDを使用して、ソースファイルを参照し、取り込む特定の項目(データタイプや形式など)を特定します。

次の認証タイプを使用して、Azure Blob Storage アカウントをExperience Platformに接続できます。

  • アカウントキー認証: ストレージアカウントのアクセスキーを使用して、Azure Blob Storage アカウントを認証し、接続します。
  • 共有アクセス署名(SAS): SAS URIを使用して、Azure Blob Storage アカウント内のリソースに委任された時間制限付きアクセスを提供します。
  • サービス プリンシパル ベースの認証: Azure Active Directory (AAD) サービス プリンシパル (クライアント IDとシークレット)を使用して、Azure Blob Storage アカウントに対して安全に認証します。

API 形式

POST /connections

ベース接続IDを作成するには、/connections エンドポイントにPOST リクエストを行い、リクエストパラメーターの一部として認証資格情報を指定します。

アカウントキー認証

アカウント キー認証を使用するには、connectionStringcontainerおよびfolderPathの値を指定してください。

code language-shell
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Azure Blob Storage connection using connectingString",
    "description": "Azure Blob Storage connection using connectionString",
    "auth": {
      "specName": "ConnectionString",
      "params": {
        "connectionString": "DefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={ACCOUNT_KEY}",
        "container": "acme-blob-container",
        "folderPath": "/acme/customers/salesData"
      }
    },
    "connectionSpec": {
      "id": "4c10e202-c428-4796-9208-5f1f5732b1cf",
      "version": "1.0"
    }
  }'
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2
パラメーター 説明
connectionString Azure Blob Storage アカウントの接続文字列。 接続文字列パターンはDefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={ACCOUNT_KEY};EndpointSuffix=core.windows.netです。
container データファイルが保存されているAzure Blob Storage コンテナの名前。
folderPath ファイルが配置されている指定されたコンテナ内のパス。
connectionSpec.id Azure Blob Storage ソースの接続仕様ID。 このIDは次のように修正されています:4c10e202-c428-4796-9208-5f1f5732b1cf
共有アクセス署名

共有アクセス署名を使用するには、sasUricontainerおよびfolderPathの値を指定してください。

code language-shell
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Azure Blob Storage source connection using SAS URI",
    "description": "Azure Blob Storage source connection using SAS URI",
    "auth": {
      "specName": "SAS URI Authentication",
      "params": {
        "sasUri": "https://{ACCOUNT_NAME}.blob.core.windows.net/?sv={STORAGE_VERSION}&st={START_TIME}&se={EXPIRE_TIME}&sr={RESOURCE}&sp={PERMISSIONS}>&sip=<{IP_RANGE}>&spr={PROTOCOL}&sig={SIGNATURE}>",
        "container": "acme-blob-container",
        "folderPath": "/acme/customers/salesData"
      }
    },
    "connectionSpec": {
      "id": "4c10e202-c428-4796-9208-5f1f5732b1cf",
      "version": "1.0"
    }
  }'
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2
パラメーター 説明
sasUri 代替の認証タイプとしてアカウントを接続するために使用できる共有アクセス署名URI。 SAS URI パターン:https://{ACCOUNT_NAME}.blob.core.windows.net/?sv={STORAGE_VERSION}&st={START_TIME}&se={EXPIRE_TIME}&sr={RESOURCE}&sp={PERMISSIONS}>&sip=<{IP_RANGE}>&spr={PROTOCOL}&sig={SIGNATURE}
container データファイルが保存されているAzure Blob Storage コンテナの名前。
folderPath ファイルが配置されている指定されたコンテナ内のパス。
connectionSpec.id Azure Blob Storage ソースの接続仕様ID。 このIDは次のように修正されています:4c10e202-c428-4796-9208-5f1f5732b1cf
サービス プリンシパル ベースの認証

サービスプリンシパルベースの認証を介して接続するには、次の値を指定します:serviceEndpointservicePrincipalIdservicePrincipalKeyaccountKindtenantcontainer、およびfolderPath

code language-shell
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Azure Blob Storage source connection using service principal based authentication",
    "description": "Azure Blob Storage source connection using service principal based authentication",
    "auth": {
      "specName": "Service Principal Based Authentication",
      "params": {
        "serviceEndpoint": "{SERVICE_ENDPOINT}",
        "servicePrincipalId": "{SERVICE_PRINCIPAL_ID}",
        "servicePrincipalKey": "{SERVICE_PRINCIPAL_KEY}",
        "accountKind": "{ACCOUNT_KIND}",
        "tenant": "{TENANT}",
        "container": "acme-blob-container",
        "folderPath": "/acme/customers/salesData"
      }
    },
    "connectionSpec": {
      "id": "4c10e202-c428-4796-9208-5f1f5732b1cf",
      "version": "1.0"
    }
  }'
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 6-row-2 7-row-2 8-row-2
パラメーター 説明
serviceEndpoint Azure Blob Storage アカウントのエンドポイント URL。 通常、形式はhttps://{ACCOUNT_NAME}.blob.core.windows.netです。
servicePrincipalId 認証に使用されるAzure Active Directory (AAD) サービス プリンシパルのクライアント/アプリケーション ID。
servicePrincipalKey Azure サービスプリンシパルに関連付けられているクライアント秘密鍵またはパスワード。
accountKind Azure Blob Storage アカウントの種類。 共通の値には、Storage (汎用V1)、StorageV2 (汎用V2)、BlobStorageおよびBlockBlobStorageが含まれます。
tenant サービス プリンシパルが登録されているAzure Active Directory (AAD) テナント ID。
container データファイルが保存されているAzure Blob Storage コンテナの名前。
folderPath ファイルが配置されている指定されたコンテナ内のパス。
connectionSpec.id Azure Blob Storage ソースの接続仕様ID。 このIDは次のように修正されています:4c10e202-c428-4796-9208-5f1f5732b1cf

リクエストが成功した場合は、一意の ID(id)を含め、新しく作成されたベース接続の詳細が返されます。 この ID は、次の手順でソース接続を作成する際に必要になります。

{
    "id": "4cb0c374-d3bb-4557-b139-5712880adc55",
    "etag": "\"1700c57b-0000-0200-0000-5e3b3f440000\""
}

次の手順

このチュートリアルに従って、APIを使用してBlob接続を作成し、応答本文の一部として一意のIDを取得しました。 この接続IDを使用して、Flow Service API🔗を使用してクラウドストレージを探索できます。

recommendation-more-help
experience-platform-help-sources