定义必要的链接服务,对我来说是一个 FTP 链接服务,然后使用 FileShare 类型的数据集从源(FTP 服务器)获取文件。在此数据集中,断言文件已压缩:
{
"name": "myFTPFileInput",
"properties": {
"published": false,
"type": "FileShare",
"linkedServiceName": "myFTPLinkedService",
"typeProperties": {
"fileName": "xyz20170316.zip",
"useBinaryTransfer": "true",
"folderPath": "/Products/xyzProducts",
"compression": {
"type": "ZipDeflate",
"level": "Optimal"
}
},
"availability": {
"frequency": "Day",
"interval": 15
},
"external": true,
"policy": {}
}
}
使用 Blobsink 将文件写入 Blob 存储:
{
"name": "myAzureBlobOutput",
"properties": {
"published": false,
"type": "AzureBlob",
"linkedServiceName": "myAzureStorageLinkedService",
"typeProperties": {
"folderPath": "mytest/ftp/xyz/{Year}/{Month}",
"format": {
"type": "TextFormat",
"rowDelimiter": "\n",
"columnDelimiter": "|"
},
"partitionedBy": [
{
"name": "Year",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "yyyy"
}
},
{
"name": "Month",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "MM"
}
}
]
},
"availability": {
"frequency": "Day",
"interval": 15
}
}
}
数据将被解压缩并作为文本写入指定的文件夹。从那里我可以使用标准 ADF 复制活动将每个文件导入到相应的 Azure SQL 表中。
希望对你有帮助