我一直在尝试将 Azure VM 部署到可用区,如以下链接https://azure.microsoft.com/en-us/blog/java-manage-availability-zones-and-more/,但我继续收到以下错误。
cannot find symbol
symbol: method withAvailabilityZone(AvailabilityZoneId)
location: interface WithCreate
似乎 Java 找不到 withAvailabilityZone 方法,但在上面的链接中它似乎工作正常。当我查看 Azure 文档时,唯一的 withAvailabilityZone 方法在 withManagedCreate 类中,所以我不确定如何更改以下代码以匹配它:
VM_1 = azure.virtualMachines().define(name)
.withRegion(reg)
.withExistingResourceGroup(rg)
.withExistingPrimaryNetworkInterface(nI)
.withPopularLinuxImage(pli)
.withExistingDataDisk(dd)
.withSize(type_1)
.withPriority(priority_var)
.withAvailabilityZone(availabilityZone) //error occurs here
.create();