[英]Copy an Excel file with empty headers Azure Data Factory (ADF)
[英]Azure Data Factory - Copy data is converting excel file to application/octet-stream
我在数据工厂中有一个管道,它正在将 excel 文件从名为 inbound 的文件夹移动到名为 raw 的文件夹,但它将 excel 文件复制为“application/octet-stream”。 我如何获取它以便将文件保存为“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”? 这是我的副本代码。
{
"name": "Copy from Inbound",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobFSReadSettings",
"recursive": true,
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "DelimitedTextSink",
"storeSettings": {
"type": "AzureBlobFSWriteSettings"
},
"formatSettings": {
"type": "DelimitedTextWriteSettings",
"quoteAllText": true,
"fileExtension": ".txt"
}
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "Blob",
"type": "DatasetReference",
"parameters": {
"container": "inbound",
"folder": {
"value": "@replace(pipeline().parameters.filePath, 'inbound/', '')",
"type": "Expression"
},
"file": {
"value": "@pipeline().parameters.fileName",
"type": "Expression"
}
}
}
],
"outputs": [
{
"referenceName": "Blob",
"type": "DatasetReference",
"parameters": {
"container": "raw",
"folder": {
"value": "@concat(replace(pipeline().parameters.filePath, 'inbound/', ''),'/',formatDateTime(utcNow(),'yyyy-mm-dd'))",
"type": "Expression"
},
"file": {
"value": "@pipeline().parameters.fileName",
"type": "Expression"
}
}
}
]
}
不幸的是,没有设置可用于在加载到存储时在复制数据活动中添加文件的内容类型属性。 添加到加载到 blob 的文件的默认内容类型是 application/octet-stream。
您可以从 Azure 数据工厂提出功能请求。
作为临时解决方案,您可以按照 MartinJaffer-MSFT 在Microsoft Q&A论坛中给出的建议进行操作。
在复制数据活动之后使用 Web 活动来请求设置 blob 属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.