windowsVM.powerOff();
System.out.println("Powered OFF VM: " + windowsVM.id() + "; state = " + windowsVM.powerState());
Network network = windowsVM.getPrimaryNetworkInterface().primaryIpConfiguration().getNetwork();
System.out.println("Creating a Linux VM in the network");
VirtualMachine linuxVM = azure.virtualMachines().define(linuxVmName)
<BUG>.withRegion(Region.US_EAST)
</BUG>
.withExistingResourceGroup(rgName)
.withExistingPrimaryNetwork(network)
.withSubnet("subnet1") // Referencing the default subnet name when no name specified at creation

windowsVM.powerOff();
System.out.println("Powered OFF VM: " + windowsVM.id() + "; state = " + windowsVM.powerState());
Network network = windowsVM.getPrimaryNetworkInterface().primaryIpConfiguration().getNetwork();
System.out.println("Creating a Linux VM in the network");
VirtualMachine linuxVM = azure.virtualMachines().define(linuxVmName)
.withRegion(region)
.withExistingResourceGroup(rgName)
.withExistingPrimaryNetwork(network)
.withSubnet("subnet1") // Referencing the default subnet name when no name specified at creation
