Error 403 when copying Excel file from Sharepoint (other files work)

Kazer 1 Reputation point
2021-09-14T15:53:39.493+00:00

Hi!

I am following the tutorial:

https://learn.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-factory#copy-file-from-sharepoint-online

Data Factory fails to load the Excel file from SharePoint. I get following error when I want to choose a sheet name in the Dataset:
"One or more errors occurred. The remote server returned an error: (403) Forbidden."

I can copy PDF files with the same pipeline from the same SharePoint when I change the Datasets. Only Excel files don't seem to work.

Any suggestions?

Best regards

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,513 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. svijay-MSFT 5,201 Reputation points Microsoft Employee
    2021-09-15T18:22:05.447+00:00

    Hello @Kazer ,

    Welcome to the Microsoft Q&A platform.

    I am assuming that you are encountering the below issue after entering the Sheet Name and Clicking OK

    132466-image.png

    Error Text

    One or more errors occurred.\r\nFailed to read data from http server. Check the error from http server:The remote server returned an error: (403) Forbidden.

    If this is not the case, can you please add some screenshot or context to the question?

    Alternatively, if this is your case, the error is occurring because ADF is trying to read the schema by connecting to the file. When you enter the Sheet Name - The Import Schema section automatically changes to the From Connection/Store - in turn tries to read the file without any token.

    132521-image.png

    However, at this stage - we do not have a token - do not have the output of the Web activity. This setting is just for the ADF to understand the Schema of the file. I had set it to None at my end

    You could one of the following at your end :

    • Set the Import Schema to None or from a Sample File
      132350-image.png

    If you set it to from a Sample File - you will have to upload a sample file that will resemble the file in Sharepoint Online Manually.

    • You could generate a token to access the file and Hardcode the Authorization Header and continue to use the From Connection/Store

    132513-image.png

    Alternatively, you could also consider copying the file as is binary type.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification