I am getting following error on azure automation when I trying to connect VM. Also follow this link https://stackoverflow.com/questions/29899964/azure-powershell-automation-no-default-subscritpion-has-been-designated

1/4/2016 3:33:14 PM, Error: Add-AzureAccount : unknown_user_type: Unknown User Type At New-AzureVMEndpoint:16 char:16

1/4/2016 3:33:14 PM, Error: Get-AzureVM : No default subscription has been designated. Use Select-AzureSubscription -Default to set the default subscription. At New-AzureVMEndpoint:20 char:20 + done

My Code :

workflow New-AzureVM

[String]  $AzureCredentialAssetName = 'AzureCredential'       
[String]  $AzureSubscriptionIdAssetName = 'dxxxxxx-xxxxxxx'

# Returns strings with status messages 

# Connect to Azure and select the subscription to work against 
$Cred = Get-AutomationPSCredential -Name $AzureCredentialAssetName 
$SubId = Get-AutomationVariable -Name $AzureSubscriptionIdAssetName 

$AzureAccount = Add-AzureAccount -Credential $Cred

echo "done"

If I Select-AzureSubscription -Default 'SubscriptionName' it throws an error saying the syntax is invalid.

Also I try to use azure in-build templates for connect the VM but on every script getting this error : Add-AzureAccount : unknown_user_type: Unknown User

1 Answer 1


Please see https://social.msdn.microsoft.com/Forums/en-US/a4f5ac38-db33-4082-a3de-b4b8d501b35a/addazureaccount-unknownusertype?forum=azureautomation.

Make sure the credential asset name (not username) is a simple string. Also make sure the credential asset username is a valid OrgID user (ex: [email protected]), not a Microsoft / Live account ([email protected]).

  • Org account fixed it for me. MSDN accounts don't work Feb 5, 2016 at 3:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .