Reputation: 1
I need to create a Azure Virtual Machine using Azure Java SDK. I wants either code of some guideline for creating VM step by step.
Upvotes: -1
Views: 951
Reputation: 24148
As I known, there are two ways for creating VM using Azure Java SDK. You can refer to their different REST APIs and authenticating request to know them.
I recommend the first one to create an Azure VM. There is a offical sample code on GitHub, please see https://github.com/Azure/azure-sdk-for-java/blob/master/azure-mgmt-samples/src/main/java/com/microsoft/azure/samples/compute/CreateVMExample.java.
As reference, the steps are as below.
Configuration
, please see https://github.com/Azure/azure-sdk-for-java/blob/master/azure-mgmt-samples/src/main/java/com/microsoft/azure/samples/authentication/ServicePrincipalExample.java to know more details.ResourceManagementClient
, StorageManagementClient
, ComputeManagementClient
& NetworkResourceProviderClient
using the Configuration
.ResourceContent
using ResouceGroupName
& Region
.createVM
of the Helper ComputeHelper
.You also can refer to the javadocs of the package com.microsoft.azure.management
for Azure Java SDK at http://azure.github.io/azure-sdk-for-java/.
Upvotes: 1