An Azure platform as a service offer that is used to deploy web and cloud applications.
Hello @Scott Schulte
Azure Automation supports system-assigned managed identity authentication to Exchange Online PowerShell, so this scenario isn't a known limitation.
One thing stands out in your description: make sure you're specifying the -Organization parameter. Microsoft documents it as required when connecting with managed identity, and the value should be the tenant's primary .onmicrosoft.com domain.
Try reducing the runbook to:
Connect-ExchangeOnline `
-ManagedIdentity `
-Organization "yourtenant.onmicrosoft.com" `
-ShowBanner:$false
Get-AcceptedDomain
Microsoft specifically recommends Get-AcceptedDomain as a simple test after establishing the managed-identity connection.
If this still returns Unauthorized, I would verify the Exchange.ManageAsApp assignment against the managed identity's service principal Object ID, not the Automation Account resource itself. Microsoft's documented configuration uses the following Exchange Online resource and application role:
$AppRoleID = "dc50a0fb-09a3-484d-be87-e023b12c6440"
$ResourceID = (
Get-MgServicePrincipal `
-Filter "AppId eq '00000002-0000-0ff1-ce00-000000000000'"
).Id
New-MgServicePrincipalAppRoleAssignment `
-ServicePrincipalId $MI_ID `
-PrincipalId $MI_ID `
-AppRoleId $AppRoleID `
-ResourceId $ResourceID
Here, $MI_ID must be the Object/Principal ID of the system-assigned managed identity.
Also keep in mind that Exchange.ManageAsApp authorizes app-only access, but the managed identity still requires appropriate Exchange RBAC/Entra role permissions for the operations it needs to perform.
Since you've already waited more than 24 hours, I wouldn't attribute this to normal permission propagation.
I would first verify the -Organization value and the Object ID used for the Exchange.ManageAsApp assignment. If both are correct and Get-AcceptedDomain still returns Unauthorized, please post the exact Connect-ExchangeOnline command (with tenant details redacted) and the full exception message.
Reference: Use Azure managed identities to connect to Exchange Online PowerShell
Please "Accept the Answer" if this information helped you. This will help us and others in the community.