【发布时间】:2019-11-25 08:31:47
【问题描述】:
在 Azure Datafactory 中,我从一台服务器复制压缩文件并将它们解压缩到另一台服务器中。 源文件具有以下名称和扩展名“sourcefile.zip”,名称中没有“.zip”,实际上是扩展名(使用文件资源管理器中的选项隐藏扩展名进行检查)。复制作业完成后文件夹解压缩,但名称中保留“.zip”,但不是压缩文件夹。
在我的作业文件中,我从源服务器的数据集执行复制作业,并获取由 foreach 循环给出的“@item”并连接通配符文件名中的“.zip”以捕获实际的 zip 文件。因为 foreach 没有给我文件的全名,如果我没有在通配符中提到“.zip”,我会收到错误 Could not find file
{
"name": "CopyDataToFileServer",
"type": "Copy",
"dependsOn": [
{
"activity": "CopyDataToIRserver",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "BinarySource",
"storeSettings": {
"type": "FileServerReadSettings",
"recursive": true,
"wildcardFileName": {
"value": "@{concat(item(),'.zip')}",
"type": "Expression"
}
}
},
"sink": {
"type": "BinarySink",
"storeSettings": {
"type": "FileServerWriteSettings",
"copyBehavior": "PreserveHierarchy"
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "IntegrationRuntimeStorageZip",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "FileServer",
"type": "DatasetReference"
}
]
},
【问题讨论】:
标签: azure azure-data-factory azure-data-factory-2