Preserve content-type when using Copy Activity to Unzip .zip Files in ADFv2

Mathis Witte 20 Reputation points
2023-08-10T09:21:57.02+00:00

Hey all,

I'm using Azure Data Factory v2 to unzip a large .zip containing different files (.html, .css, etc) using a Copy Activity. The source and sink datasets are each a normal azure blob storage.

The issue I'm having is, that all the unzipped files have content-type "application/octet-stream" instead of "text/html" or "text/css", etc..

It seems like there should be an option in the Copy-Activity so set attributes to preserve (see https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-preserve-metadata) but I don't have this option in my web interface and setting it in the json also doesn't do anything - it just gets removed after saving the new json definition.

Is there any way to solve this problem with data factory tools/configuration only? Since using an additional azure function to change all the content-types again isn't a feasible option.

Thanks!

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

Accepted answer
  1. Bhargava-MSFT 31,261 Reputation points Microsoft Employee Moderator
    2023-08-14T20:38:06.5966667+00:00

    Hello Mathis Witte,

    Welcome to the Microsoft Q&A forum.

    Unfortunately, the Copy Activity in Azure Data Factory does not have an option to preserve the content-type of the files being copied. Currently, the 'Content-Type' properties of the file that were copied via ADF will be 'application/octet-stream'

    As you mentioned, one possible solution to this problem is to use an Azure Function to update the content-type of the unzipped files after they have been copied to the destination blob storage.

    This feature request has been logged in the ADF ideas forum.

    https://feedback.azure.com/d365community/idea/6664d52e-5466-ed11-a81b-000d3ae49307

    I would suggest upvoting and commenting on this feature request.

    PG actively monitors and reviews all the feedback shared in this forum, prioritizing them accordingly based on the number of requests.

    I hope this info helps. Please let me know if you have any further questions.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.