I am trying to use the Azure Java SDK to automate tasks for my azure virtual machines such as starting and stopping them at various stages of the day
I was looking at the azure documentation for start virtual machine here
The method signature in question is as follows
OperationResponse beginStarting(java.lang.String serviceName,
java.lang.String deploymentName,
java.lang.String virtualMachineName)
throws java.io.IOException,
ServiceException
I was wondering - where can I get the values for serviceName and deploymentName on the azure console for my virtual machine?
I tried looking on the old portal and the new portal but to date I have been unable to find these values
This question looks like a duplicate to the question at the below url but it is not Azure find deployment name
Indeed when you look at the old portal (https://manage.windowsazure.com) - the above link gives the correct answer for getting a deployment name
However, if you create a VirtualMachine in the old portal and view it in the new portal (https://portal.azure.com) - it shows under the Virtual Machine Classic option. With the help of the above link I was able to perform operations on the classic virtual machines using the Java SDK
If I create a Virtual Machine in the new portal under the Virtual Machine option (not Virtual Machine (classic)) I am unable to find the deploymentName or serviceName
So to update the question - how does one find the deploymentName and serviceName for a Virtual machine in the new portal
Also - one other thing I noticed with the SDK - If you have the wrong serviceName entered - it logs that the deployment name is wrong - that got me for a while on the classic virtual machines
Just to close out this question To be able to perform operations on non classic virtual machines - use this maven dependency
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-compute</artifactId>
<version>0.9.0</version>
</dependency>
For operations on non classic virtual machines - you need to use Active Directory Security - see this link - https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/ To perform operations on classic virtual machines - use this maven dependency
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-svc-mgmt-compute</artifactId>
<version>0.9.0</version>
</dependency>
For operations on classic virtual machines - you need to use certs