title: Get Azure VM status : "running , stopped" using resource manager deployment and rest api
body: <p>i've deployed a vm using Resource Manager deployment model.</p>
  
  <p>Using rest api as described here: <a href="https://msdn.microsoft.com/en-us/library/azure/mt163682.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/azure/mt163682.aspx</a>
  i'm able to get informations about my VM. But i cannot see if the VM is running or not. I want that information to start/stop the VM Automatically via code.</p>
  
  <p>Does anyone have tried that and get the VM powerstate?</p>
  
  <p>best regards...</p>
  
  <p>i make a GET using this URI </p>
  
  <pre><code>string.Format("https://management.azure.com/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Compute/virtualMachines/{2}?api-version={3}", subscriptionID, resssourcegroup, vmname,apiversion);
  </code></pre>
  
  <p>apiversion is 2016-03-30.</p>