Get-AzureRmResourceGroup 不从当前订阅返回资源

Tyl*_*Ham 6 powershell azure

如果我跑

Get-AzureSubscription -Current
Run Code Online (Sandbox Code Playgroud)

我得到:

SubscriptionId            : a*<guid>
SubscriptionName          : Development                         
Environment               : AzureCloud                          
DefaultAccount            : t*<guid>          
IsDefault                 : True                                
IsCurrent                 : True                                
TenantId                  : 4*<guid>
Run Code Online (Sandbox Code Playgroud)

然后我运行:

Get-AzureRmResourceGroup
Run Code Online (Sandbox Code Playgroud)

根据门户网站的说法,返回的两个资源都不在该订阅中,其中应该有很多资源:

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
Run Code Online (Sandbox Code Playgroud)

这些来自我的另一个订阅,但如您所见,不是当前订阅。

为什么没有Get-AzureRmResourceGroup获取当前订阅中的资源组,现在我要解决这个问题吗?

我的 Azure 模块是 0.9.11 版,AzureRM 是 1.0.1 版。我也无权访问Switch-AzureModeGet-AzureResourceGroup

Tyl*_*Ham 9

我不得不使用

Select-AzureRmSubscription -SubscriptionId a*<guid>
Run Code Online (Sandbox Code Playgroud)

感谢Michael Rodger提供答案。