Add-AzureAccount : unknown_user_type: Unknown User Type on azure automation
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]).
Related videos on Youtube
rgg
Updated on September 18, 2022Comments
-
rgg over 1 year
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 [OutputType([String])] # 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 Get-AzureAccount Get-AzureVM 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
-
Shane Castle over 8 yearsOrg account fixed it for me. MSDN accounts don't work