Hi @TechGeek ,
I am wondering which user are you using for the Azure Connection.
In my case I am using the AzureRunAsConnection
which is automatically created during setup the Azure Automation Account.
This account was added manually to the Contributor role in the second Azure Subscription.
In my PowerShell script it is this part to use the AzureRunAsConnection
:
$Conn = Get-AutomationConnection -Name AzureRunAsConnection
Add-AzureRMAccount -ServicePrincipal -Tenant $Conn.TenantID `
-ApplicationID $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint
Could you please verify which account is used for the connection in your script and if this account got the permission (role).
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten