- The command
(Get-AzureRmADUser -Mail $user).Id
in a Azure PowerShell Task returned null when running on a self-hosted agent in VSTS - The problem was that the Service Principal needs to have the permission to read from the Active Directory
How can I give the the Service Principal the correct permissions to read from the Azure Active Directory?