Data Landing Zone
Data Landing Zone是由Adobe Experience Platform设置的Azure Blob存储接口,允许您访问安全、基于云的文件存储设施,以将文件导入Platform。 您有权访问每个沙盒一个Data Landing Zone容器,所有容器的总数据量以您的Platform产品和服务许可证提供的总数据为限。 所有Experience Platform客户都为每个沙盒配置一个Data Landing Zone容器。 您可以通过Azure Storage Explorer或命令行界面将文件读取和写入容器。
Data Landing Zone支持基于SAS的身份验证,其数据受标准Azure Blob存储安全机制的静态和传输保护。 基于SAS的身份验证允许您通过公共Internet连接安全地访问Data Landing Zone容器。 访问Data Landing Zone容器不需要更改网络,这意味着您不需要为网络配置任何允许列表或跨区域设置。 Experience Platform对上传到Data Landing Zone容器的所有文件和文件夹强制实施严格的七天过期时间。 所有文件和文件夹都会在七天后删除。
设置您的Data Landing Zone源以在Azure上Experience Platform azure
请按照以下步骤了解如何设置您的Data Landing Zone帐户以在Azure上Experience Platform。
文件和目录的命名约束
以下是命名云存储文件或目录时必须考虑的约束列表。
- 目录和文件组件名称不能超过255个字符。
- 目录和文件名不能以正斜杠(
/
)结尾。 如果提供,它将自动删除。 - 以下保留URL字符必须正确转义:
! ' ( ) ; @ & = + $ , % # [ ]
- 不允许使用以下字符:
" \ / : | < > * ?
。 - 不允许使用非法的URL路径字符。 诸如
\uE000
之类的代码点虽然在NTFS文件名中有效,但不是有效的Unicode字符。 此外,还不允许使用某些ASCII或Unicode字符,如控制字符(如0x00
到0x1F
、\u0081
等)。 有关HTTP/1.1中Unicode字符串的规则,请参阅RFC 2616,第2.2节:基本规则和RFC 3987。 - 不允许使用以下文件名:LPT1、LPT2、LPT3、LPT4、LPT5、LPT6、LPT7、LPT8、LPT9、COM1、COM2、COM3、COM4、COM5、COM6、COM7、COM8、COM9、PRN、AUX、NUL、CON、CLOCK$、点字符(.)和两个点字符(…)。
管理数据登陆区域的内容 manage-the-contents-of-your-data-landing-zone
您可以使用Azure Storage Explorer管理Data Landing Zone容器的内容。
在Azure Storage Explorer UI的左侧导航中选择连接图标。 出现 选择资源 窗口,为您提供连接选项。 选择 Blob container 以连接到Data Landing Zone。
接下来,选择 共享访问签名URL (SAS) 作为连接方法,然后选择 下一步。
选择连接方法后,必须提供与Data Landing Zone容器对应的 显示名称 和 Blob容器SAS URL。
提供您的Data Landing Zone SAS URL,然后选择 下一步
此时将显示 摘要 窗口,其中提供了设置的概述,包括有关Blob端点和权限的信息。 准备就绪后,选择 连接。
成功连接将更新包含Data Landing Zone容器的Azure Storage Explorer用户界面。
在将Data Landing Zone容器连接到Azure Storage Explorer后,您现在可以开始将文件上传到Data Landing Zone容器。 要上载,请选择 上载,然后选择 上载文件。
选择要上载的文件后,您必须确定要将它上载为的Blob类型以及所需的目标目录。 完成后,选择 上传。
使用命令行界面将文件上载到Data Landing Zone
您还可以使用设备的命令行界面并访问上传文件到Data Landing Zone。
使用Bash上载文件
以下示例使用Bash和cURL通过Azure Blob Storage REST API将文件上传到Data Landing Zone:
# Set Azure Blob-related settings
DATE_NOW=$(date -Ru | sed 's/\+0000/GMT/')
AZ_VERSION="2018-03-28"
AZ_BLOB_URL="<URL TO BLOB ACCOUNT>"
AZ_BLOB_CONTAINER="<BLOB CONTAINER NAME>"
AZ_BLOB_TARGET="${AZ_BLOB_URL}/${AZ_BLOB_CONTAINER}"
AZ_SAS_TOKEN="<SAS TOKEN, STARTING WITH ? AND ENDING WITH %3D>"
# Path to the file we wish to upload
FILE_PATH="</PATH/TO/FILE>"
FILE_NAME=$(basename "$FILE_PATH")
# Execute HTTP PUT to upload file (remove '-v' flag to suppress verbose output)
curl -v -X PUT \
-H "Content-Type: application/octet-stream" \
-H "x-ms-date: ${DATE_NOW}" \
-H "x-ms-version: ${AZ_VERSION}" \
-H "x-ms-blob-type: BlockBlob" \
--data-binary "@${FILE_PATH}" "${AZ_BLOB_TARGET}/${FILE_NAME}${AZ_SAS_TOKEN}"
使用Python上传文件
以下示例使用Microsoft’s Python v12 SDK将文件上传到Data Landing Zone:
import os
from azure.storage.blob import ContainerClient
try:
# Set Azure Blob-related settings
sasUri = "<SAS URI>"
srcFilePath = "<FULL PATH TO FILE>"
srcFileName = os.path.basename(srcFilePath)
# Connect to container using SAS URI
containerClient = ContainerClient.from_container_url(sasUri)
# Upload file to Data Landing Zone with overwrite enabled
with open(srcFilePath, "rb") as fileToUpload:
containerClient.upload_blob(srcFileName, fileToUpload, overwrite=True)
except Exception as ex:
print("Exception: " + ex.strerror)
使用AzCopy上载文件
以下示例使用Microsoft’s AzCopy实用工具将文件上传到Data Landing Zone:
copy
命令时,您可以使用其他命令和选项使用AzCopy将文件上载到Data Landing Zone。 有关详细信息,请参阅此Microsoft AzCopy 文档。set sasUri=<FULL SAS URI, PROPERLY ESCAPED>
set srcFilePath=<PATH TO LOCAL FILE(S); WORKS WITH WILDCARD PATTERNS>
azcopy copy "%srcFilePath%" "%sasUri%" --overwrite=true --recursive=true
设置您的Data Landing Zone源以便在Amazon Web Services上Experience Platform aws
请按照以下步骤了解如何设置您的Data Landing Zone帐户以在Amazon Web Services (AWS)上Experience Platform。
设置AWS CLI并执行操作
- 请阅读有关安装或更新到AWS CLI最新版本的指南。
使用临时凭据配置AWS CLI
使用AWS configure
命令设置带有访问密钥和会话令牌的CLI。
aws configure
出现提示时,输入以下值:
- AWS访问密钥ID:
{YOUR_ACCESS_KEY_ID}
- AWS访问密钥:
{YOUR_SECRET_ACCESS_KEY}
- 默认区域名称:
{YOUR_REGION}
(例如,us-west-2
) - 默认输出格式:
json
接下来,设置会话令牌:
aws configure set aws_session_token your-session-token
处理Amazon S3上的文件
模板:
code language-shell |
---|
|
示例:
code language-shell |
---|
|
模板:
code language-shell |
---|
|
示例:
code language-shell |
---|
|
使用您的Data Landing Zone凭据登录到AWS控制台
提取您的凭据
首先,您必须获得以下内容:
awsAccessKeyId
awsSecretAccessKey
awsSessionToken
生成登录令牌
接下来,使用提取的凭据创建会话,并使用AWS联合端点生成登录令牌:
import json
import requests
# Example DLZ response with credentials
response_json = '''{
"credentials": {
"awsAccessKeyId": "your-access-key",
"awsSecretAccessKey": "your-secret-key",
"awsSessionToken": "your-session-token"
}
}'''
# Parse credentials
response_data = json.loads(response_json)
aws_access_key_id = response_data['credentials']['awsAccessKeyId']
aws_secret_access_key = response_data['credentials']['awsSecretAccessKey']
aws_session_token = response_data['credentials']['awsSessionToken']
# Create session dictionary
session = {
'sessionId': aws_access_key_id,
'sessionKey': aws_secret_access_key,
'sessionToken': aws_session_token
}
# Generate the sign-in token
signin_token_url = "https://signin.aws.amazon.com/federation"
signin_token_payload = {
"Action": "getSigninToken",
"Session": json.dumps(session)
}
signin_token_response = requests.post(signin_token_url, data=signin_token_payload)
signin_token = signin_token_response.json()['SigninToken']
构建AWS控制台登录URL
一旦您拥有登录令牌,即可在AWS控制台中构建用于将您记录并直接指向所需Amazon S3存储段的URL。
from urllib.parse import quote
# Define the S3 bucket and folder path you want to access
bucket_name = "your-bucket-name"
bucket_path = "your-bucket-folder"
# Construct the destination URL
destination_url = f"https://s3.console.aws.amazon.com/s3/buckets/{bucket_name}?prefix={bucket_path}/&tab=objects"
# Create the final sign-in URL
signin_url = f"https://signin.aws.amazon.com/federation?Action=login&Issuer=YourAppName&Destination={quote(destination_url)}&SigninToken={signin_token}"
print(f"Sign-in URL: {signin_url}")
访问AWS Console
最后,导航到生成的URL,以使用您的Data Landing Zone凭据直接登录AWS控制台,从而提供对Amazon S3存储段内特定文件夹的访问权限。 登录URL会将您直接转到该文件夹,确保您只能看到和管理允许的数据。
将Data Landing Zone连接到Experience Platform
以下文档提供了有关如何使用API或用户界面将数据从Data Landing Zone容器引入Adobe Experience Platform的信息。