question

SteveWedge-0340 avatar image
0 Votes"
SteveWedge-0340 asked SteveWedge-0340 answered

Why does an Azure Automation Runbook script behave differently when the job is created by a Logic App as opposed to Power Automate Workflow?

I have an Azure Automation Runbook running a PowerShell script. This runbook has been successfully executing and completing for a number of weeks, being initiated from a Power Automate workflow which is itself triggered by the creation of an entry in a SharePoint list. Due to licensing considerations I have been exploring using an Azure Logic App for the workflow. In doing this I have encountered very strange behaviour within the Runbook script. If I disable (Turn Off) the PowerAutomate workflow and let the Logic App workflow handle the process, then the script throws an error where this cmdlet is used

New-PSDrive : This function is not supported on this system

The script also keeps returning to the start and repeating, as if in a loop. This continues until Azure suspends the process.

I can disable the Logic App and turn on the Power Automate workflow, run the process again, without making any changes to the runbook and it will run successfully to completion, without any issues.

This makes no sense whatsoever and I can't think why creating the job from the 2 different sources would make this massive difference to the viability of the Runbook

azure-logic-appsazure-automation
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SteveWedge-0340 avatar image
0 Votes"
SteveWedge-0340 answered

Answering my own question.

The script needed to be run on a Hybrid Worker and I had not configured that parameter on the Azure Logic App Script. When that parameter was given a valid value the Logic App executed successfully without any errors

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.