Azure: Know your Azure VM created date using PowerShell & AzCli.

Do you want know when was your Azure VM created? Then this script will retrive date time created for the given Azure VM(s). Not sure whether there is direct way to retrieve the VM created date, but I couldn’t find any CmdLet to know the VM created date.

However, I have written a PowerShell function to know the VM created date by considering the VM OS disk creation date as VM creation date.

The function accepts the combination of Resource Group Name and VM Name as mandatory parameters or VM object(s), and you will see the output as below…

Screenshot from 2019-09-25 22-21-12

And, here is the script…

And even I have tried the same using Azure Cli as well, and it worked like this…

And you get the output like this

Screenshot from 2019-09-26 09-30-03

Thank you.