Azure Data Factory read spreadsheet with Protected View

Naveed Mohammad 0 Reputation points
2024-06-13T19:34:11.5233333+00:00

I have a logic app workflow that is triggered when a new email is received in a mailbox. The workflow copies the attachment (spreadsheet) in the email, to Azure Blob Storage. I then trigger an Azure Data Factory pipeline to read the contents of the spreadsheet and copy them to a SQL table.

The issue I have is that when the logic app copies the attachment (spreadsheet) to the blob, excel marks it as "Protected View" and my ADF pipeline cannot read the contents of the file. This is the error ADF Copy activity shows when it cannot read the file "Encrypted excel file {filename} is not supported, please remove its password. Wrong Local header signature: 0x41C". The excel file is not password protected, it just opens in Protected View.

If I manually download the spreadsheet, click "Enable Editing" and re-upload the excel to the blob, ADF pipeline works just fine. How do I get around this issue? Any help would be appreciated.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,965 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,661 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,045 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 18,981 Reputation points
    2024-06-14T09:02:42.4733333+00:00

    It appears that your file is still encrypted and protected. Currently, ADF does not support encrypted or protected Excel files out of the box. To handle such files, you may need to rely on additional functionalities, such as using Azure Function Apps to extract data or custom code to convert the encrypted Excel file to a normal one before copying.

    To verify if your Excel file is encrypted, could you please try opening it both in ADLS and locally?

    Links to help you :

    https://stackoverflow.com/questions/68775892/how-to-copy-a-password-protected-excel-file-in-azure-data-factory

    https://learn.microsoft.com/en-us/azure/data-factory/format-excel

    0 comments No comments