I am trying to execute Get-AzureADServicePrincipal in a azure powershell task in ADO. I need to get service principal for me to then connect to get ServicePrincipalId and ServicePrincipalkey. As part of this I am trying the below, as an inline script
Install-Module -Name AzureAD Get-AzureADServicePrincipal
But this keeps failing as,
WARNING: User declined to install module (AzureAD)
[error]The term 'Get-AzureADServicePrincipal' is not recognized as the name of a cmdlet
Please could some one help? Thanks