使用Java SDK在Azure上创建虚拟机
我需要从azure java sdk创建虚拟机。我将maven依赖项集成到我的项目中。我需要一个简单的教程。你能帮我吗使用Java SDK在Azure上创建虚拟机,azure,Azure,我需要从azure java sdk创建虚拟机。我将maven依赖项集成到我的项目中。我需要一个简单的教程。你能帮我吗 谢谢你可以在测试包中使用VirtualMachineOperationsTest类,这里:。最近azure推出了[java api 1.0.0][1]作为稳定版本。我将遵循1.0.0SDK来帮助您创建虚拟机 1. Create a azure authentication file with all credentials subscription=<enter_su
谢谢你可以在测试包中使用VirtualMachineOperationsTest类,这里:。最近azure推出了[java api 1.0.0][1]作为稳定版本。我将遵循1.0.0SDK来帮助您创建虚拟机
1. Create a azure authentication file with all credentials
subscription=<enter_subscription>
client=<enter_client>
key=<enter_key>
tenant=<enter_tenant>
managementURI=https\://management.core.windows.net/
baseURL=https\://management.azure.com/
authURL=https\://login.windows.net/
graphURL=https\://graph.windows.net/
2. Get Azure client to perform an operation in azure
`final File credFile = new File("/Users/risanand/cliqr.azureauth");
Azure azure = Azure.configure()
.withLogLevel(LogLevel.BASIC)
.authenticate(credFile)
.withDefaultSubscription();`
3. Create virtual machine
`VirtualMachine windowsVM = azure.virtualMachines().define("vmName")
.withRegion("regionname")
.withNewResourceGroup("resourceGroupName")
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIPAddressDynamic()
.withoutPrimaryPublicIPAddress()
.withAdminUsername(userName)
.withAdminPassword(password)
.withNewDataDisk(10)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();`
[1]: https://github.com/Azure/azure-sdk-for-java
答案中的链接已失效。