Assign the Application to the "Hybrid Identity Administrator" Azure role as well.
Get-MgServicePrincipalSynchronizationJob fails with Status: Unauthorized for Application based Authentication.
I am trying to create an automation using application permissions to get synchronization job status and am getting the following error "Get-MgServicePrincipalSynchronizationJob_Get: The server responded with a Request Error, Status: Unauthorized"
Debug output shows app only and scopes correctly.
DEBUG: [CmdletBeginProcessing]: - Get-MgServicePrincipalSynchronizationJob begin processing with parameterSet 'Get'.
DEBUG: [Authentication]: - AuthType: 'AppOnly', AuthProviderType: 'ClientCredentialProvider', ContextScope: 'Process', AppName: '****'.
DEBUG: [Authentication]: - Scopes: [Application.ReadWrite.OwnedBy, Application.ReadWrite.All, Directory.ReadWrite.All].
Any suggestions would be appreciated.