我在 Azure 上有很多租户,我使用 Powershell 来管理它们。
我已连接我的账户:
Login-AzureRmConnect
Account SubscriptionName TenantId Environment
------- ---------------- -------- -----------
[email protected] Microsoft Partner Network XXXXX-XXXX-XXXX-XXXX-XXXX AzureCloud
当我想使用 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
当我这样做时Get-AzureRmSubscription
:
Get-AzureRmSubscription
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
AVERTISSEMENT : Unable to acquire token for tenant 'XXXXX-XXXX-XXXX-XXXX-XXXX'
Name Id TenantId State
---- -- -------- -----
Microsoft Partner Network XXXXX-XXXX-XXXX-XXXX-XXXX XXXXX-XXXX-XXXX-XXXX-XXXX Enabled
Microsoft Azure XXXXX-XXXX-XXXX-XXXX-XXXX XXXXX-XXXX-XXXX-XXXX-XXXX Enabled
XXXX - XXXXXXX XXXXX-XXXX-XXXX-XXXX-XXXX XXXXX-XXXX-XXXX-XXXX-XXXX Enabled
在它工作之前,Azure 的门户没有任何变化。
你能帮助我吗 ?
感谢您
答案1
我无法使用评论。
可能是其他订阅基于不同的租户?如果是这种情况,请尝试使用Connect-AzureRmAccount -TenantId