azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmResource needs -SubscriptionLevel switch

Open gregjhogan opened this issue 9 years ago • 5 comments

I want to query a subscription level resource. I can do it with -ResourceId, but since you have a -TenantLevel switch it seems logical to add a -SubscriptionLevel switch.

Get-AzureRmResource -ResourceType "Microsoft.MarketplaceOrdering/Agreements" -SubscriptionLevel

Thanks!

gregjhogan avatar Aug 08 '17 02:08 gregjhogan

@ravbhatnagar Hey Gaurav, would you mind taking a look at this issue?

cormacpayne avatar Aug 11 '17 18:08 cormacpayne

@ravbhatnagar the Get-AzureRmResource cmdlet now leverages the ARM SDK rather than using a generic HttpClient to make the request to get resources -- is there any plan to support the above scenario in the SDK?

cormacpayne avatar Jul 05 '18 23:07 cormacpayne

Hi @gregjhogan

AzureRm is in maintenance mode and the Az module is now the Azure Powershell module that is updated, maintained, and recommended moving onward.

In the Az module, and the May 2018 update to the AzureRm module, the TenantLevel parameter was removed as a part of the switch to using the ARM SDK to make calls. The default scope for Get-AzureRmResource and Get-AzResource calls is at the Subscription scope. Confirmed this with @cormacpayne as he worked on this.

Sounds like this is specific to resources that only exist at the Subscription level, in which case this is a feature request.

snaheth avatar Feb 22 '20 02:02 snaheth

:bell: Routing this issue to @act-identity-squad.

The -ResourceId path from the original description still works. -SubscriptionLevel was proposed as parity with -TenantLevel, which was removed in the ARM SDK migration, so the parity rationale no longer applies. Not planned; closing on that basis.

MaddyMicrosoft avatar Aug 24 '26 10:08 MaddyMicrosoft