I have a bit of a complicated requirement and so, I'm sorry if the title sounds vague. But here's what I'm trying to do.
So I have an automation account let's say AutomationAccount_Parent in subscription_01. This has a runbook that creates a new automation account (AutomationAccount_Child) in subscription_02 and also creates the RunAs account for this child automation account. (Calling it "child" just for clarity)
Now along with the creation of this RunAs account of AutomationAccount_Child, I also want the Parent runbook to provide "Read Directory Data" AAD permission to the AAD application that gets created for AutomationAccount_Child.
Note: This permission needs to be given TO child automation account's AD application BY the parent runbook in Parent Automation Account.
Now the Questions:
- Is this possible?
- Can you please help me with the cmdlet? I'm unable to find a suitable cmdlet.
- What permission on the AAD does the PARENT automation account need in the first place, to be able to provide this kind of permission to the child automation accounts?