添加Azure帐户:unknown_user_type:未知用户inputazure自动化

当我尝试连接虚拟机时,出现以下Azure自动化错误。 也请按照此链接https://stackoverflow.com/questions/29899964/azure-powershell-automation-no-default-subscritpion-has-been-designated

1/4/2016 3:33:14 PM,错误:Add-AzureAccount:unknown_user_type:未知用户types在New-AzureVMEndpoint:16 char:16

1/4/2016 3:33:14 PM,错误:Get-AzureVM:没有指定默认订阅。 使用Select-AzureSubscription – 默认设置默认订阅。 在新Azure VMEndpoint:20个字符:20 +完成

我的代码:

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" } 

如果我selectAzureSubscription – 默认“SubscriptionName”它会引发错误,说明语法无效。

此外,我尝试使用Azure内部生成模板连接虚拟机,但每个脚本获取此错误: Add-AzureAccount:unknown_user_type:未知的用户

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

确保凭证资产名称(不是用户名)是一个简单的string。 还要确保凭证资产用户名是有效的OrgID用户(例如:[email protected]),而不是Microsoft / Live帐户([email protected])。