How to store Azure Data Factory copy activity output as json instead of octet-stream

56 Views Asked by At

I'm currently working with Azure Data Factory (ADF) and using it to store a file in a datalake for a Python script (in the form of an Azure Function) to use. However, the Python script isn't properly picking up the file because ADF is saving the json as an octet-stream. Is there any setting I can use to make it so ADF saves the file properly, or alternatively is there a good way for me to read octet files in Python?

Any and all help is appreciated.

1

There are 1 best solutions below

0
Pratik Lad On

When you Copy file from Azure Data Factory copy activity it gets copied as content-type octet-stream by default.

As a workaround solution, you can set propertied for blob using Web Activityby calling blob api to set properties. This should be executed after the Copy activity completes.

URL - https://yourstorageaccountname.blob.core.windows.net/containername/directory/file.json?<Sas token wil all permission>
Method - Put
Body - {}
Headers:
x-ms-blob-content-type - application/json
x-ms-version - 2020-04-08
x-ms-blob-type - BlockBlob

enter image description here

Output:

enter image description here