Hi,
we have created a flow that is kicked off via a button in a canvas Power App, which passes a parameter of AccountName.
This is used as a Runbook Parameter for the PowerShell script within the Runbook called 'EnableAccount' that requires an accountName param.
The flow has an azure AD connection which basically calls the runbook job.
The job enables an account on an On Prem AD so we have an Hybrid Automation worker group.
Let's say the account that enables the account in AD on prem is AccountA - credentials specified in runbook etc.
The Automation account is AccountB (has read over scope permission)
The Create Job connection Account is AccountC (has write over scope permission)
The issue is, since AccountC has correct permission (write over permissions scope ) when Account C uses the canvas app and clicks the button to fire off the flow (to enable account) the flow runs without error and runbook runs OK and Account is Enabled.
However, when a normal user (with permission to the canvas app) clicks the button the flow fails with error:
Does not have authorization to perform action 'Microsoft.Automation/automationAccounts/jobs/write' over scope
We're not understanding why flow is not using the Account C credentials specified in the Create Job connection and is instead trying to use the credentials of the user who initialized the Flow.
We do not want to have to give all users who require to use the app, write over scope, but instead, only have the account specified for the connection do the work, make the connection.
Our create job connection is set up as below:
Any help in understanding the setup, why this is happening is highly appreciated.
