Can't Copy file from SharePoint to Azure Store account

Chuck Wang 0 Reputation points
2024-07-22T07:17:21.6533333+00:00

Hi,

I want to copy file from SharePoint to Azure storage account. Follow the instruction here

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

But I continuous failed in the last step,

User's image

Here is the Error message:

"Code": 22755,

		"Message": "ErrorCode=HttpRequestFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Http request failed with client error, status code 404 NotFound, please check your activity settings. If you configured a baseUrl that includes path, please make sure it ends with '/'.\nRequest URL: https://[mysharepointsite]/_api/web/GetFileByServerRelativeUrl('/sites/ProjectCk/Shared Documents/MOCK_DATA_Azure.csv')/$value.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Net.WebException,Message=The remote server returned an error: (404) Not Found.,Source=System,'"

(I replace the sharepoint site by [mysharepointsite])

And I found this,

https://learn.microsoft.com/en-us/answers/questions/1607878/iam-trying-to-capture-sharepoint-files-into-azure

Seems we met the similar issue.

And I follow the answer's step checked everything. But still failed.

  • I already grand the SharePoint admin permission and get the access_token,
  • When I copy the baseURL: https://[mysharepointsite]/_api/web/GetFileByServerRelativeUrl('/sites/ProjectCk/Shared Documents/MOCK_DATA_Azure.csv')/$value to my browser, it can download the data.
  • I'm the contributor role of the storage account.
  • Here's my storage account configuration:

User's image

User's image

Can you help me look at it and how I can solve this problem?

Many thanks,

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,925 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,160 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,265 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 19,781 Reputation points
    2024-07-22T21:32:42.97+00:00

    I already answered something similar to an old thread :

    Based on this old thread, the error code that you are having 22755 is related to ADF and it indicates a client-side failure, specifically a 400 Bad request error. I think that the service principal or managed identity being used are missing the necessary permissions to access Azure Data Lake Storage Gen2. Even if you have an access token for SharePoint, the service principal or managed identity might still lack the required permissions for Azure Data Lake Storage Gen2. To troubleshoot this error, consider the following steps:

    1. Review the Detailed Error Message: Check the specific error message from Azure Data Lake Storage Gen2. If it indicates a transient issue, try the operation again.
    2. Verify Permissions: Ensure the service principal or managed identity has the necessary permissions for both SharePoint and Azure Data Lake Storage Gen2. Refer to the Azure documentation on service principal authentication for guidance.
    3. Check Firewall Rules: Confirm that the firewall settings for Azure Data Lake Storage Gen2 allow Azure Data Factory IP addresses. See the Azure documentation on configuring Azure Storage firewalls and virtual networks for more details.
    4. Validate Base URL Configuration: Ensure the base URL in your activity configuration ends with a forward slash (/). If the URL includes a path, it must end with a forward slash to prevent errors. I hope this clarifies the error code and assists you in troubleshooting the issue. Feel free to ask if you have any more questions or concerns.

  2. Nehruji R 4,606 Reputation points Microsoft Vendor
    2024-07-23T11:17:48.2466667+00:00

    Hello Chuck Wang,

    Greetings! Welcome to Microsoft Q&A Platform.

    The error message you’re encountering indicates that the file path or URL you’re using in your request is not found. It looks like the full stop at the end of the URL in the error message might be part of the error message formatting rather than the actual URL being used. However, it’s important to ensure that the URL is correctly formatted and ends with a /

    Check if there are any special characters in the file name or path that may be causing the issue. Ensure that the access token you are using is valid and has not expired.

     Verify that the file exists in the specified location. The above error message is thrown when the required blob name is not received by your pipeline data set. Since you are manually testing the pipeline, it won't have a file name which is why you might be getting this error. In order to test your storage event trigger, you will have to manually/automatically drop a file in the folder for which your storage event trigger is configured or looking for. When the blob is dropped to your source folder the events get fired and the trigger is executed and the folderPath and fileName as passed from your trigger properties to your pipeline parameters and from there to your dataset parameters and your pipeline executes without issues.

    Please make sure that your event trigger is configured to the correct source folder. Would recommend to double check your trigger configuration as well as your dataset configuration to make sure both are pointing to the same source folder path.

    refer this doc for more details - https://learn.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-factory#troubleshoot-common-issues

    Check the logs and diagnostics in Azure Data Factory to see if there are any additional details about the error.

    Hope this information helps! please let us know if you have any further queries. I’m happy to assist you further.


    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments