How do I get the unattached disks and/or orphan disks in my environment using Azure Log Analytics

%3CLINGO-SUB%20id%3D%22lingo-sub-727812%22%20slang%3D%22en-US%22%3EHow%20do%20I%20get%20the%20unattached%20disks%20and%2For%20orphan%20disks%20in%20my%20environment%20using%20Azure%20Log%20Analytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727812%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20a%20doubt%2C%20is%20possible%20I%20use%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fforums%2Fpostpage%2Fboard-id%2FAzureLogAnalytics%23%22%20target%3D%22_blank%22%3EAzure%20Log%20Analytics%3C%2FA%3E%26nbsp%3Bto%20get%20informations%20about%20unattached%20and%20orphan%20disk%20in%20my%20subscription%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20now%20that%20I%20can%20achieve%20this%20using%20PowerShell%2C%20but%20if%20possible%20I%20like%20to%20use%20KQL.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-727812%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2127404%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20I%20get%20the%20unattached%20disks%20and%2For%20orphan%20disks%20in%20my%20environment%20using%20Azure%20Log%20Analytic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2127404%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EYou%20might%20have%20found%20a%20solution%2C%20but%20this%20is%20how%20I%20get%20mine%20(or%20a%20variation%20of%20this)%3A%3CBR%20%2F%3E%3CBR%20%2F%3Eresources%3CBR%20%2F%3E%7C%20where%20type%20%3D~%20'Microsoft.Compute%2Fdisks'%3CBR%20%2F%3E%7C%20where%20managedBy%20%3D%3D%20''%3CBR%20%2F%3E%7C%20project%20name%2C%20resourceGroup%2C%20Sku%3Dsku.tier%2C%20DiskState%3Dproperties.diskState%2C%20location%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%3CBR%20%2F%3EJ%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello All,

 

I've a doubt, is possible I use Azure Log Analytics to get informations about unattached and orphan disk in my subscription?

 

I now that I can achieve this using PowerShell, but if possible I like to use KQL. 

 

Tks

1 Reply
Hi,
You might have found a solution, but this is how I get mine (or a variation of this):

resources
| where type =~ 'Microsoft.Compute/disks'
| where managedBy == ''
| project name, resourceGroup, Sku=sku.tier, DiskState=properties.diskState, location


Cheers
J