使用API連線Azure Blob Storage至Experience Platform
建立對象:
- 開發人員
閱讀本指南,瞭解如何使用Azure Blobg StorageAPIFlow Service 將您的帳戶連結至Adobe Experience Platform。
快速入門
本指南需要您深入了解下列 Adobe Experience Platform 元件:
使用Experience Platform API
如需如何成功呼叫Experience Platform API的詳細資訊,請參閱Experience Platform API快速入門指南。
收集必要的認證
閱讀Azure Blob Storage 總覽以取得驗證的相關資訊。
將您的Azure Blob Storage帳戶連線至Experience Platform
請閱讀下列步驟,以瞭解如何將Azure Blob Storage帳戶連線至Experience Platform。
建立基礎連線
基礎連線會將您的來源連結至Experience Platform,以儲存驗證詳細資料、連線狀態和唯一ID。 使用此ID來瀏覽來源檔案並識別要擷取的特定專案,包括其資料型別和格式。
您可以使用下列驗證型別,將您的Azure Blob Storage帳戶連線至Experience Platform:
- 帳戶金鑰驗證:使用儲存體帳戶的存取金鑰來驗證並連線至您的Azure Blob Storage帳戶。
- 共用存取簽章(SAS):使用SAS URI提供您Azure Blob Storage帳戶中資源的委派、有限時間存取權。
- 以服務主體為基礎的驗證:使用Azure Active Directory (AAD)服務主體(使用者端ID和密碼)來安全地驗證您的Azure Blob儲存帳戶。
API格式
POST /connections
若要建立基礎連線ID,請對/connections端點提出POST要求,並提供您的驗證認證作為要求引數的一部分。
若要使用帳戶金鑰驗證,請提供您connectionString、container和folderPath的值。
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"
}
}'
connectionStringDefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={ACCOUNT_KEY};EndpointSuffix=core.windows.net。containerfolderPathconnectionSpec.id4c10e202-c428-4796-9208-5f1f5732b1cf。若要使用共用存取權簽章,請提供您sasUri、container和folderPath的值。
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"
}
}'
sasUrihttps://{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}。containerfolderPathconnectionSpec.id4c10e202-c428-4796-9208-5f1f5732b1cf。若要透過以服務主體為基礎的驗證連線,請提供下列專案的值: serviceEndpoint、servicePrincipalId、servicePrincipalKey、accountKind、tenant、container以及folderPath。
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"
}
}'
serviceEndpointhttps://{ACCOUNT_NAME}.blob.core.windows.net。servicePrincipalIdservicePrincipalKeyaccountKindStorage (一般用途V1)、StorageV2 (一般用途V2)、BlobStorage和BlockBlobStorage。tenantcontainerfolderPathconnectionSpec.id4c10e202-c428-4796-9208-5f1f5732b1cf。成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id)。 建立來源連線的下一個步驟需要此ID。
{
"id": "4cb0c374-d3bb-4557-b139-5712880adc55",
"etag": "\"1700c57b-0000-0200-0000-5e3b3f440000\""
}
後續步驟
依照本教學課程,您已使用API建立Blob連線,且已取得唯一ID作為回應本文的一部分。 您可以使用此連線ID來使用Flow Service API🔗探索雲端儲存空間。