'Azure Data Factory - Copy data is converting excel file to application/octet-stream
I have a pipeline in data factory that is moving an excel file from a folder named inbound to a folder named raw, but it copies the excel file as "application/octet-stream". How do I get it so it keeps the file as "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"? Here is the code I have for the copy.
{
"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"
}
}
}
]
}
Solution 1:[1]
Unfortunately, there is no setting available to add a content-type property of a file in Copy data activity when loaded to storage. The default content type added to the file loaded to blob is application/octet-stream.
You can raise a feature request from the Azure data factory.
As a temporary solution, you follow the suggestion given by MartinJaffer-MSFT in the Microsoft Q&A forum.
Use Web activity after your copy data activity to make a request to set the blob properties.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NiharikaMoola-MT |

