2
votes

Is it possible to run Powershell script from azure data factory pipeline as an activity, I have a UC where I need to move all the processed files from "input" folder to a folder called "processed" in Data Lake. I does have a powershell script for the same, however I want this to get executed from a Data Factory PipeLine.

what i did was created a custom ".Net dll" that would call a ".BAT" which in turn calls ".ps1", then I have integrated custom ".Net dll" as an activity in a pipeline but that does not seems to be working

please suggest if it is the write way of doing the above UC or there is any better solution for it.

1
Based on your description, you only need to move files from one folder to another? Then why not just use a Copy activity for your UC? - Yitao Zhang
thanks Yitao for your comments, the copy activity will just copy the files but it won't move the files, if that's the case I will have to move the files manually from source once it gets copied to destination using copy activity - Vijay Ande

1 Answers

0
votes

So I had similar requirement in my case as well, I had to move files once the files were imported in our Azure database. What I did was create a pipeline which had the below:

  1. Created Copy data activity to copy files from the main folder to the processed folder in Azure file share server.
  2. Upon success of the copy activity I added a delete activity which deleted the files.

Hope this helps.