title: What is the correct way of determining the launch time of an Azure VM?
body: <p>Using the Azure REST API (or any tool that communicates over the REST API, such as the <a href="https://github.com/Azure/azure-cli" rel="nofollow noreferrer" title="azure-cli">azure-cli</a>), what would be the correct way to determine the age of a VM or find out the time when the VM was booted?</p>
  
  <p>Neither <code>az vm list</code> nor <code>az vm get-instance-view</code> appears to give me an obvious answer.</p>
  
  <p>My first assumption was that the <code>statuses</code> seen when running <code>az vm get-instance-view</code> would indicate the boot time via the <code>time</code> of the <code>provisioningState</code> (as in the example below), <em>however</em>, this timestamp gets updated if I, for instance, set a new tag on the VM.</p>
  
  <pre><code>"statuses": [
            {
              "code": "ProvisioningState/succeeded",
              "displayStatus": "Provisioning succeeded",
              "level": "Info",
              "message": null,
              "time": "2016-12-08T09:45:14.956230+00:00"
            },
            {
              "code": "PowerState/running",
              "displayStatus": "VM running",
              "level": "Info",
              "message": null,
              "time": null
            }
          ]
  </code></pre>
  
  <p>Although a bit far-fetched, my main candidate so far is the <code>time</code> found on the OS disk's provisioning status:</p>
  
  <pre><code>  "instanceView": {
      "bootDiagnostics": null,
      "disks": [
        {
          "name": "testvm-1480595334683-os-disk",
          "statuses": [
            {
              "code": "ProvisioningState/succeeded",
              "displayStatus": "Provisioning succeeded",
              "level": "Info",
              "message": null,
              "time": "2016-12-01T12:30:35.583526+00:00"
            }
          ]
        }
      ]
  </code></pre>
  
  <p>I've searched for any official documentation on this topic but come up empty-handed. I'm assuming that there <em>is</em> a way, since I can come up with several reasons why it would be useful to know the age of a VM.</p>