小编Goe*_*ems的帖子

无法使用 Powershell 连接到正确的 Azure 订阅

我在 Azure 上有很多租户,我使用 Powershell 来管理它们。

我正在连接我的帐户:

Login-AzureRmConnect

Account                     SubscriptionName          TenantId                             Environment
-------                     ----------------          --------                             -----------
XXX@XXXX.XXX                Microsoft Partner Network XXXXX-XXXX-XXXX-XXXX-XXXX            AzureCloud
Run Code Online (Sandbox Code Playgroud)

当我想用有效的 SubscriptionID 更改订阅时,我有以下答案:

Select-AzureRmSubscription -SubscriptionId "XXXX-XXXX-XXXX-XXXXX-XXXXXX"
Select-AzureRmSubscription : Please provide a valid tenant or a valid subscription.
Au caractère Ligne:1 : 1
+ Select-AzureRmSubscription -SubscriptionId "XXXX-XXXX-XXXX-XXXXX-X ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError : (:) [Set-AzureRmContext], ArgumentException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.SetAzureRMContextCommand
Run Code Online (Sandbox Code Playgroud)

当我这样做时Get-AzureRmSubscription

Get-AzureRmSubscription
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
AVERTISSEMENT : Unable to acquire …
Run Code Online (Sandbox Code Playgroud)

powershell azure azure-powershell

3
推荐指数
1
解决办法
4041
查看次数

标签 统计

azure ×1

azure-powershell ×1

powershell ×1