Is it possible to delete certain file types using ADF Delete step?

muntazir abbas 65 Reputation points
2024-02-13T16:03:43.0166667+00:00

Hello Community, I have a task that involves unzipping a file and only keeping the .json files from it. The other files that come with the zip are not needed. I use a copy activity to unzip the file and move it to another location, but I want to delete the other file types from the sink. For example, after unzipping I get these files

  • .json
  • .client
  • .session
  • .xml

How can I remove the non-.json files from the sink after the copy activity is done? Any better way to do the job?

I appreciate any suggestions.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,776 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,521 questions
{count} votes

Accepted answer
  1. Nandan Hegde 31,946 Reputation points MVP
    2024-02-13T16:47:40.94+00:00

    You can use Delete activity by leveraging wildcard path : User's image

    Since 1 file type can be passed at a time, you can create a parameter with all wildcard values semicolon seperated like .xml;.csv and use foreach activity with expression as split(parameter,';') and iterate the wildcard in Delete activity

    1 person found this answer helpful.

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.