Principals of type Application cannot validly be used in role assignments

New-AzRoleAssigment -objectid service_principal -RoleDefinitionName “Managed Identity Operator” -Scope ResourceID

In case of error:

Principals of type Application cannot validly be used in role assignments

 

Please provide -objectid Service Principal, not Application. Just display it, by:

Get-AzureADServicePrincipal -SearchString “app_name”