Power Automate Flow runs Azure Automation Job and get file

Laveau, Adrien 21 Reputation points
2024-02-01T12:48:21.5433333+00:00

Hello,
In Power Apps I am running a cloud flow that runs an Azure Automation Job on an hybrid worker (on of my VMs). The job is a powershell scripts that runs an *.exe file that produces a text file.

I need to get this file back on my sharepoint.

Is there a way to get this file back ? For the moment to get the file content I do the following :

  • write the file into the powershell command
  • use the "Job output" connector from power automate"
  • Save the text into a file

But this is not a solution I like due to all the possible errors in text translation that can occur.

Could I get the file directly in some other way?

Thank you

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,177 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
545 questions
{count} votes

Accepted answer
  1. Dan Rios 1,735 Reputation points MVP
    2024-02-01T20:11:08.82+00:00

    Could just have another Automation Runbook PowerShell script that invokes the SharePoint REST API to upload the file using the hybrid worker again.

    You’ll need to setup a service account or similar to authenticate during the Runbook. There’s an existing PS script already here that could use in the new runbook:

    https://www.powershellgallery.com/packages/NVRAppDevOps/2.0.21/Content/Upload-FileToShp.ps1

    Then once the job is completed with a successful return code, you can continue with your flow, if not then the condition could stop the flow and notify you there was an issue uploading the file.


0 additional answers

Sort by: Most helpful