【问题标题】:Add-AzureAccount in Azure-runbook fails with: The given key was not present in the dictionaryAzure-runbook 中的 Add-AzureAccount 失败:字典中不存在给定的键
【发布时间】:2016-07-23 21:46:51
【问题描述】:

直到最近,这两行代码在我的 Azure-Powershell-Workflow Runbook 中都能完美运行。

$azureCredential = Get-AutomationPSCredential –Name "<asset-name>"
Add-AzureAccount -credential $azureCredential

现在它失败并显示错误消息Add-AzureAccount : The given key was not present in the dictionary. 对$azureCredential 的检查没有发现任何可疑之处。

问我必须怎么做才能让它重新开始?

【问题讨论】:

    标签: azure azure-powershell azure-automation runbook


    【解决方案1】:

    如果凭据无权访问任何 RDFE(Azure 服务管理)订阅,则 Add-AzureAccount 中可能会发生此错误。您可以按照指示 here 将凭据添加到 RDFE 订阅。

    【讨论】:

    • 您如何将订阅重新分配给用户,以便我更新答案?
    • 对不起,我之前的评论有误,所以我把它删除了。我删除并随后添加了用户并重新分配了共同管理员角色。然后它又工作了。
    猜你喜欢
    • 1970-01-01
    • 2012-02-18
    • 2016-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多