Azure - Orphaned Resources dashboard
Introduction
resources
| where type == 'microsoft.compute/snapshots'
| extend TimeCreated = properties.timeCreated
| where TimeCreated < ago(30d)
| summarize count(type)
VM:
resources
| where type == 'microsoft.compute/virtualmachines'
| extend vmstatus = properties.extended.instanceView.powerState.displayStatus
| where vmstatus != 'VM running'
| summarize count(type)
Alerts:
resources
| where type contains 'microsoft.insights/scheduledqueryrules' or type contains 'microsoft.insights/activitylogalerts' or type contains 'microsoft.insights/metricalerts'
| extend alertstatus = properties.enabled
| where alertstatus == 'false'
| summarize count(name)
LB:
resources
| where type == "microsoft.network/loadbalancers"
| where properties.loadBalancingRules == "[]"
| summarize count(type)
Certificate Expiration(Defined 30 days as an example)
resources
| where type == 'microsoft.web/certificates'
| extend expiry = todatetime(properties.expirationDate)
| where expiry between (now().. ago(-30d))
| project CertName=properties.subjectName, expiry
Virtual Networks without Subnet
Finally, the Dashboards would be like the below one,
Let me know your comments if any.
Comments
Clone the new tile from the workbook and use the below Resource graph query to create new dashboards?
I will be thankful to you I did not understand the steps to achieve that but i want learn and understand the same I hope you will help me, thanks in Adv.
I'm happy that you've gone through my blog and asked questions. As i mentioned you've to follow the this link(https://github.com/dolevshor/azure-orphan-resources) to import the baseline workbook and then import it using the provided steps. Once you imported click to edit the workbook and clone the tile like below,
Since there is no option to add the images into the reply section, click on the below link to see the images.
Cloning: https://drive.google.com/file/d/17pYl2CiETEzZOdD_YOkHz7-Lgc-Vm5g6/view?usp=sharing
Query Editor: https://drive.google.com/file/d/1whK5XiXOBDLILrd_4GH4WFARLbiZdRS4/view?usp=sharing
Let me know if the above pictures are able to help you out. Thank you!
Regards,
Logan
Thank you so much for the reply.
i am really very happy and blessed that I got reply I will go through the steps which you have mentioned. I have already copied code from github and implemented but the only which i was unable to achieve addition stuff as below: unable to achieve only addition stuff clone tiles and get additional data like for snapshot e.g.
Additionaly, Clone the new tile from the workbook and use the below Resource graph query to create new dashboards.
I will go through the steps shared by and will share result with you..
Sir you are just awesome. Sorry for late reply.