4

I use Power Automate to fetch some data from SQL database and save them into different excel files. After my workflow is done, I have 8 different excel file, and I need to do some data preprocessing on them. I've got the python script which consists of various libraries such as pandas etc. and does the job but I need to make it automate.

What I want is basically after my workflow is done, running the python script automatically with Power Automate.

I read some articles about it such as article1. Is there any other way except using the azure functions? Because it seems a bit complex and it's only free for 12 months.

Rutkay Karabulak
  • 107
  • 1
  • 2
  • 12
  • 1
    My first approach would be to drop the excel files into a blob storage container and have your azure function trigger on new blobs arriving to the container. – GuillemB Apr 01 '21 at 13:51
  • So your suggestion is simply to create an Azure function... Can you review 5th of 6 messages in [this](https://powerusers.microsoft.com/t5/General-Power-Automate/Execute-python-script-from-Power-Automate-Flow/td-p/550328) topic. Do you think that it'd be the solution? – Rutkay Karabulak Apr 01 '21 at 13:56
  • I belive that what he is doing is watching for file changes onthe one drive folder synced on his computer. The watch runs a script when a file shows up. That's at least what I understand from his answer. That could be okay, but it does require you to have your computer running 24/7 (or a VM with the synced onedrive folder). Using azure functions allows you to forget about that. Also it's free for 12 months but if you are processing just a few small files a day the cost will be literally pennies. – GuillemB Apr 01 '21 at 14:49
  • 1
    This might be helpful if you opt for the solution on the forum: https://stackoverflow.com/questions/29066742/watch-file-for-changes-and-run-command-with-powershell – GuillemB Apr 01 '21 at 14:49
  • Thanks a lot @GuillemB , sorry for late reply I was in a hurry. I think I go with azure solution. – Rutkay Karabulak Apr 03 '21 at 11:24
  • @RutkayKarabulak may I ask, how did you solve your concern? I am in a similar project, I have a excel file with multiple tabs and multiple formulas, I tried to keep making formulas for their solution, but it seems a little bit odd and outdated. An automate python file would be the best solution for me. PD. the azure function option looks complicated. – Andres Mitre Mar 06 '22 at 01:43
  • 2
    @AndresMitre Hi, I solved my problem as following; I implemented a python script that solves my problem, afterwards I published my python script via Azure so that it will run everyday, if you ask what I used as a trigger to run python code my answer is Power Automate. Power automate was triggering my azure code every day. However, if I were old me I would basically use the windows's task scheduler to run my code daily basis. – Rutkay Karabulak Mar 12 '22 at 09:55

1 Answers1

1

As far as I know, we can just use azure function to run python script in power automate. I think the best solution is use azure function which you are using now.

For you concern about cost, you can create the function with a free app service plan (if your requirements do not need high performance). You can refer to this document about app service plan.

enter image description here

Even though you don't choose free app service plan, it will not cost much more if you choose consumption plan for your function.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18