I have installed AzureRm and Azure module on Windows server 2012 R2. I can run other cmdlets from this module (eg.AddAzureRmAccount, Get-AzureRmSubscription) but Login-AzureRmAc
NOTE: Please use azure RM login to connect via service principal as :
$applicationId = "$securePassword = "ServicePrincipal Passowrd" | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword
Connect-AzureRmAccount -ServicePrincipal -Credential $credential -TenantId "ServicePrincipal Tenant ID"
Login-AzureRmAccount
Install-Module AzureRM -Scope CurrentUser
Get-Module -List
Seems like their powergallery setup is broken, I installed it using webPI and it is working fine.
For webPI download instructions:
https://regularitguy.com/2014/03/13/installing-the-windows-azure-powershell-cmdlets/