Jan 03 2021
01:26 PM
- last edited on
Apr 08 2022
10:42 AM
by
TechCommunityAP
Jan 03 2021
01:26 PM
- last edited on
Apr 08 2022
10:42 AM
by
TechCommunityAP
Hi there, I would like to find out how long (how many years/Month/days) certain virtual machines running on Azure. How can fetch these details?
Cheers
Salai
Jan 04 2021 08:11 AM
depending on your expectations, it may or not be possible to get the information you want.
1. The VM's operating system can tell you the uptime, but this is mostly inaccurate, as the VM may have rebooted many times since its creation.
2. Azure Activity Log provides you with an history of operations made on your Azure resources (creation, update, delete), but it is queryable only for the past 90 days. Again, a solution that falls short, unless you were exporting Activity Logs to a Storage Account or Log Analytics workspace with a longer retention.
3. If you look at the VM's OS managed disk properties, you can see when the disk was created (see capture below). This solution would work for all your VMs that run on managed disks, provided the OS disk was never swapped.
Out of the box, there is not a 100% accurate answer, but I hope these hints help you somehow.
Jan 10 2021 12:42 PM