Delete the file from SharePoint location

ADF_Coder 0 Reputation points
2024-05-22T10:16:27.3866667+00:00

Hi All,

I am trying to copy the files from Share Point to ADLS and referring to the below URL pipeline to achieve the copy functionality.

https://www.syntera.ch/blog/2022/10/10/copy-files-from-sharepoint-to-blob-storage-using-azure-data-factory/

I need help to know how I can delete the file after the files get copied in ADF itself (not power automate). It will be helpful If you can explain with flow.

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,485 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,218 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,843 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 26,186 Reputation points
    2024-05-22T20:46:11.4833333+00:00

    You can use a copy activity :

    • Set up your SharePoint source. You'll need to configure the linked service for SharePoint, which requires the URL of the SharePoint site and authentication details.
    • Specify the files or folder to be copied.

    Then, configure the sink like below :

    • Set up your Azure Data Lake Storage destination. Configure the linked service for ADLS.
    • Specify the container and folder in ADLS where the files should be copied.

    Next step, you need to set up the web activity to delete the file :

    • URL: Set the URL to delete the file from SharePoint. This URL will be specific to your SharePoint instance and the file to be deleted.
    • Method: Set the HTTP method to DELETE.
    • Headers: Add any necessary headers for authentication and content type.
    • Body: Add any required body content, if applicable. Usually, for a DELETE request, the body is not needed.
    • Authentication: Set up authentication. If SharePoint uses OAuth, you will need to configure an OAuth token.

    Finally you may need to create a dependency between the Copy Data activity and the Web activity.


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.