Microsoft azure – Determining VM State

Microsoft azure platform provides a lot of exciting features and is very much as par with competition from AWS and google. However, there remain a few questions around the documentation and examples offered by the platform for developers – or maybe just for JAVA developers in particular who use the Azure java SDK.

 

In particular, I found some difficulty dealing with async VM launches and determining VM states accurately. The SDK team has been very helpful in providing examples and getting in touch for answering questions regarding the SDK. I am sharing here some code snippet which may be helpful to other developers treading the same path.

 

The method given below shows how you can read and categorize a VM’s state to a concrete tangible machine state.

(more…)