【发布时间】:2016-08-15 17:40:02
【问题描述】:
我正在使用 Azure 中的经典资源。我正在运行 Azure powershell 2.0.1 版(更新它以查看是否解决了以下问题)。 我想检查我的 VIPS 列表,并且正在运行一些我在 powershell 中为此准备的脚本。
$deployment = Get-AzureDeployment -ServiceName servicenamehere
$deployment.VirtualIPs
我现在收到错误
Get-AzureDeployment : Account with name '' does not exist.
Parameter name: accountName
At line:1 char:15
+ $deployment = Get-AzureDeployment -ServiceName servicenamehere
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureDeployment], ArgumentException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand
许多其他语句返回相同的错误“名称为 '' 的帐户不存在。”这一切都是在登录并选择我的订阅后执行的,效果很好:
Add-AzureAccount
Select-AzureSubscription -SubscriptionName "subscriptionnamehere"
关于导致他们因这个 accountName 问题而失败的语句中发生的事情有什么想法吗?不确定这是否与资源管理器更改或 Azure 过去几个月中添加的任何其他新内容有关。
其他语句失败并出现相同的错误。示例
Add-AzureVirtualIP -VirtualIPName newvipname -ServiceName servicenamehere
给出同样的错误
Add-AzureVirtualIP : Account with name '' does not exist.
Parameter name: accountName
【问题讨论】:
-
尝试
Select-AzureSubscription -SubscriptionName "subscriptionnamehere" -Account "accountidhere"(使用Get-AzureAccount查找正确的帐户ID) -
太好了,成功了!想知道为什么我现在需要那个。几个月前我们改用 Azure AD,不确定是否相关。
标签: powershell azure azure-powershell