0

Each Monday, I have a number of files arrive in to a Sharepoint folder Folder consists of Folder/different clients. I have a python script (also stored on a different location in sharepoint) that transforms these files in the different clients folder and produces an output file.

All I want to do is have something, be it in data factory or any suggestion, to poll if the Sharepoint folder has a modified file, then trigger the python script to run.

Looking for ideas.

5
  • Can you please provide the details of what you have tried so far? Commented Mar 25 at 10:25
  • I am looking at Power Automate - executepython requires a premium so thats a no go. Commented Mar 25 at 10:38
  • I'm trying to figure out using Azure Function App but i am not looking for an input/output result as my python script will do this. I am thinking about Watchdog from what i've seen on this forum but again, i only want this when a new file is added/overwrites/modifies in the client folders. Watchdog however is more a notification; its not going to trigger my python script to do transformations and output the result. I just want something to see when a new file arrives on my sharepoint folder to trigger the python script Commented Mar 25 at 10:40
  • You can use [GetMetdata Activity] learn.microsoft.com/en-us/azure/data-factory/… to look for lastmodified meta data of file/folder. Compare this new lastmodified date with previous last modified date , if the new last modified date is greater then execute the python script using Azure Function. Commented Mar 25 at 13:20
  • I am going to try this suggestion. Waiting on Support team to grant me the access to enter my AppId on the Sharepoint side of things. I cant access that at the moment. It's just blocker after blocker. Commented Mar 27 at 9:14

1 Answer 1

0

All I want to do is have something, be it in data factory or any suggestion, to poll if the Sharepoint folder has a modified file, then trigger the python script to run.

You can try the below possible workarounds in this scenario. Considering that you need a standard type, you can achieve the below using standard type of logic app.

  1. Using Function app with Logic app:

    If you could try to modify your code as per the function app, then you can opt for this approach. You can use When an item is created or modified trigger in the logic app with SharePoint connector and set the timer as per your requirement. Upon the trigger, call Azure function app with the desired authentication method.

  2. Using ADF Custom activity with logic app: This approach involves ADF Custom activity. So, it needs the python script file to be in Storage account. If you don't want to modify your existing code, then you can try this approach. First have a logic app and copy the SharePoint python code file to an ADLS gen2 storage account. Or you can directly download and upload the same as it's only a one-time process. Take a logic app with same When an item is created or modified trigger and then, take ADF connector with desired authentication method. Take the Create a pipeline run action. In the ADF pipeline, add a Custom activity with the required python file selected. You can go through this MS documentation to know how to configure a Custom activity.

    After building the pipeline with custom activity, publish the pipeline. In the logic app, select the same pipeline.

    enter image description here

    In this step, you can pass the parameters like modified file name if there is a need. But you need to ensure that you define those parameters in the pipeline in first place.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.