如果我跑
Get-AzureSubscription -Current
我得到:
SubscriptionId : a*<guid> SubscriptionName : Development Environment : AzureCloud DefaultAccount : t*<guid> IsDefault : True IsCurrent : True TenantId : 4*<guid>
然后我运行:
Get-AzureRmResourceGroup
根据门户网站的说法,这两个资源都没有被返回,其中应该有很多资源。
ResourceGroupName : Default-SQL-NorthCentralUS Location : northcentralus ProvisioningState : Succeeded Tags : ResourceId : /subscriptions/0*<guid>*e/resourceGroups/Default-SQL-NorthCentralUS ResourceGroupName : Default-Web-NorthCentralUS Location : northcentralus ProvisioningState : Succeeded Tags : ResourceId : /subscriptions/0*<guid>*e/resourceGroups/Default-Web-NorthCentralUS
这些来自我的另一个订阅,但正如你所看到的,不是现在的订阅。
为什么Get-AzureRmResourceGroup不能Get-AzureRmResourceGroup当前订阅中的资源组,现在是否解决了这个问题?
我的Azure模块版本是0.9.11,AzureRM是1.0.1版本。 我也无法访问Switch-AzureMode或Get-AzureResourceGroup
我不得不使用
Select-AzureRmSubscription -SubscriptionId a*<guid>
感谢Michael Rodger提供的答案。
如果您有多个订阅,则需要使用下面的命令设置上下文:
Set-AzureRmContext -SubscriptionName "Name"