0

Tell me please, how can I get all options for instance on Azure using Java ?

For example, I mean all VM parameters: name, instance type, launch time and etc. So that I can use them in my code and get a detailed message in case of all kinds of errors associated with the VM on Azure. Thanks

Kirill Sereda
  • 469
  • 1
  • 10
  • 25

1 Answers1

1

You can use Azure virtual machine libraries to manage your virtual machines.

To use Azure management library, firstly, you need to get authenticated. For more details, you may refer to: Authentication in Azure Management Libraries for Java


Another way is to use Azure REST API. Here is the tutorial for your getting started: https://learn.microsoft.com/en-us/rest/api/azure/

You can use HttpClient or You can also directly try that API on the page:

enter image description here

Jack Jia
  • 5,268
  • 1
  • 12
  • 14
  • Thanks for your answer. If I understand correctly, then this is all the parameters for the Virtual Machine: subscriptionId, resourceGroupName, vmName, $expand, api-version ? – Kirill Sereda Nov 05 '19 at 08:02
  • Yes. `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}` is the resource ID. And `api-version` is used for specifying the target api version. `$expand` is optional. – Jack Jia Nov 05 '19 at 08:24