List ALL ARM and ASM/Classic resources with AzureRM PowerShell?

%3CLINGO-SUB%20id%3D%22lingo-sub-284419%22%20slang%3D%22en-US%22%3EList%20ALL%20ARM%20and%20ASM%2FClassic%20resources%20with%20AzureRM%20PowerShell%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-284419%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20noticed%20that%20the%20PowerShell%20cmdlet%20%3CSTRONG%3EGet-AzureRMResource%3C%2FSTRONG%3E%20(from%20AzureRM%20module%20v6.12.0)%20returns%20some%20classic%20resources%20types%2C%20which%20is%20great%20and%20helps%20for%20what%20I%20need%20to%20do%20(get%20an%20inventory%20of%20all%20resources%20across%20all%20of%20our%20subscriptions).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%26nbsp%3BI'm%20hoping%20to%20find%20out%20if%20this%20is%20a%20%3CU%3Edependable%3C%2FU%3E%20and%20%3CU%3Ecomplete%3C%2FU%3E%20listing%20of%20all%20classic%20resources%20in%20the%20subscription%3F%20or%20are%20there%20still%20classic%20resources%20that%20are%20not%20exposed%20to%20the%20ARM%20cmdlets%2FAPI%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESome%20of%20the%20resource%20types%20returned%20are%3C%2FP%3E%3CUL%3E%3CLI%3E%3CFONT%3EMicrosoft.ClassicCompute%2FdomainNames%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%3EMicrosoft.ClassicCompute%2FvirtualMachines%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%3EMicrosoft.ClassicStorage%2FstorageAccounts%3C%2FFONT%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3ENote%3A%26nbsp%3B%20I'm%20running%20the%20commands%20under%20as%20an%20ARM%20%22Reader%22%20RBAC%20role%20holder%20at%20the%20subscription%20level%2C%20but%20I%20do%20not%20have%20ASM%20'administrator'%20or%20'co-administrator'%20rights.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-284419%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Resource%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EClassic%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-825952%22%20slang%3D%22en-US%22%3ERe%3A%20List%20ALL%20ARM%20and%20ASM%2FClassic%20resources%20with%20AzureRM%20PowerShell%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-825952%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4347%22%20target%3D%22_blank%22%3E%40Bryan%20Hall%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20you're%20well%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3EI%20would%20like%20to%20know%20if%20you%20have%20found%20the%20solution%20to%20this%20query%2C%20I%20was%20looking%20for%20the%20same%20and%20came%20across%20this%20article.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20do%20let%20me%20know.%3C%2FP%3E%3CP%3EThank%20you%20very%20much%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-825968%22%20slang%3D%22en-US%22%3ERe%3A%20List%20ALL%20ARM%20and%20ASM%2FClassic%20resources%20with%20AzureRM%20PowerShell%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-825968%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F399381%22%20target%3D%22_blank%22%3E%40PramodYuki%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhile%20I%20never%20got%20a%20confirmation%20that%20the%20command%20results%20are%20dependable%20and%20complete%2C%20in%20my%20case%2C%20they%20were.%26nbsp%3B%20I%20eventually%20got%20owner%20(rbac)%20and%20service%20admin%20(classic)%20permissions%20to%20the%20subscription%20and%20visually%20compared%20the%20PS%20results%20to%20the%20portal.%26nbsp%3B%20We%20only%20had%20a%20few%20classic%20resources%2C%20so%20I%20can't%20say%20that%20other%20classic%20resource%20types%20would%20or%20would%20not%20be%20included%20in%20the%20PS%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-825974%22%20slang%3D%22en-US%22%3ERe%3A%20List%20ALL%20ARM%20and%20ASM%2FClassic%20resources%20with%20AzureRM%20PowerShell%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-825974%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4347%22%20target%3D%22_blank%22%3E%40Bryan%20Hall%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20taking%20the%20time%20to%20reply%2C%20I%20understand%20what%20you're%20saying%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20bothered%20with%20an%20issue%20in%20my%20azure%20account%2C%20I%20am%20not%20sure%20if%20I%20have%20to%20create%20a%20new%20post%20for%20this%20query%2C%20but%20I%20would%20greatly%20appreciate%20your%20insights%20on%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20%22Virtual%20network%20(classic)%22%20resource%20which%20I%20want%20to%20delete%2C%20but%20it%20looks%20like%20there%20is%20a%20dependency%20linked%20to%20this%20resource%20i.e%2C%20%22Class%20application%20gateway%22.%20Every%20time%20I%20try%20to%20delete%20it%20the%20following%20error%20shows%20up%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESucceeded%3A%200%2C%20Failed%3A%201%2C%20Canceled%3A%200.%3CBR%20%2F%3EError%20details%3CBR%20%2F%3E%3CSTRONG%3EResource_name%3C%2FSTRONG%3E%3A%20Delete%20command%20failed%20with%20HTTP%20error%20code%3A%20400%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20also%20tried%20deleting%20the%20resource%20group%20as%20a%20whole%20but%20no%20luck.%20and%20hence%20I%20am%20trying%20to%20pull%20out%20all%20the%20classic%20resource%20in%20a%20resource%20group%20but%20I%20just%20see%20the%26nbsp%3BVirtual%20network%20(classic).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20you%20have%20any%20pointers%20that%20I%20could%20follow%2C%20I%20have%20been%20on%20this%20for%20a%20while%20%3A)%3C%2Fimg%3E%3CBR%20%2F%3EMy%20sincere%20gratitude%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I've noticed that the PowerShell cmdlet Get-AzureRMResource (from AzureRM module v6.12.0) returns some classic resources types, which is great and helps for what I need to do (get an inventory of all resources across all of our subscriptions).

 

However, I'm hoping to find out if this is a dependable and complete listing of all classic resources in the subscription? or are there still classic resources that are not exposed to the ARM cmdlets/API?

 

Some of the resource types returned are

  • Microsoft.ClassicCompute/domainNames
  • Microsoft.ClassicCompute/virtualMachines
  • Microsoft.ClassicStorage/storageAccounts

 

Note:  I'm running the commands under as an ARM "Reader" RBAC role holder at the subscription level, but I do not have ASM 'administrator' or 'co-administrator' rights.

3 Replies
Highlighted

@Bryan Hall 

Hope you're well :)

I would like to know if you have found the solution to this query, I was looking for the same and came across this article.

 

Please do let me know.

Thank you very much

Highlighted

Hello @PramodYuki,

 

While I never got a confirmation that the command results are dependable and complete, in my case, they were.  I eventually got owner (rbac) and service admin (classic) permissions to the subscription and visually compared the PS results to the portal.  We only had a few classic resources, so I can't say that other classic resource types would or would not be included in the PS results.

 

 

Highlighted

@Bryan Hall 

Thank you for taking the time to reply, I understand what you're saying :)

 

I am bothered with an issue in my azure account, I am not sure if I have to create a new post for this query, but I would greatly appreciate your insights on this.

 

I have a "Virtual network (classic)" resource which I want to delete, but it looks like there is a dependency linked to this resource i.e, "Class application gateway". Every time I try to delete it the following error shows up 

Succeeded: 0, Failed: 1, Canceled: 0.
Error details
Resource_name: Delete command failed with HTTP error code: 400

I have also tried deleting the resource group as a whole but no luck. and hence I am trying to pull out all the classic resource in a resource group but I just see the Virtual network (classic).

 

Please let me know if you have any pointers that I could follow, I have been on this for a while :)
My sincere gratitude