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
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
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