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

Steve Wedge 31 Reputation points
2022-03-24T15:57:37.627+00:00

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 Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,839 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,113 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Steve Wedge 31 Reputation points
    2022-03-25T10:08:57.983+00:00

    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

    0 comments No comments