I've made the call to virtualMachines.get to retrieve instance information about my VM. In the output I don't see where you get the status of the VM (stopped, running, deallocated). Is there another way to get the status that I'm looking for?
Asked
Active
Viewed 31 times
1 Answers
1
use the optional query parameter $expand=instanceView.
Example:
//assuming you have instantiated the client ...
let options = {expand: 'instanceView'};
client.virtualMachines.get('rg-name', 'vm-name', options).then((vminfo) => {
console.dir(vminfo, {depth: null, colors: true});
}).catch((err) => {
console.dir(err, {depth: null, colors: true});
});
Documentation found here.

brennazoon
- 1,379
- 2
- 12
- 11