I am working on a Java application and my requirement is
1. To check if my Azure Virtual Machine is in stopped state.
2. Since when (Date/Time) it is in stopped state.
Azure Java SDK is preference but Rest API will also suffice.
I am working on a Java application and my requirement is
1. To check if my Azure Virtual Machine is in stopped state.
2. Since when (Date/Time) it is in stopped state.
Azure Java SDK is preference but Rest API will also suffice.
You can get all the information of VM on Azure through Java sdk com.microsoft.azure.management.compute.VirtualMachine
, for more details, you can reference the code Get information about the VM.
Update
Java SDK com.microsoft.azure.credentials.ApplicationTokenCredentials
for vm authentication and method statuses()
of SDK com.microsoft.azure.management.compute.VirtualMachineInstanceView
to get vm state. If you want to get the time of stop state, you can read the time from the log.