Hi,
I've got issue creating a VM inside a virtual network using powershell.
I have a VirtualNetwork :
<VirtualNetworkSites><VirtualNetworkSite name="rsp-eu-west" Location="West Europe"><AddressSpace><AddressPrefix>10.155.8.0/21</AddressPrefix></AddressSpace><Subnets><Subnet name="RSP"><AddressPrefix>10.155.8.0/24</AddressPrefix></Subnet></Subnets></VirtualNetworkSite>
A CloudService in an affinity group located in West Europe, A Storage Account in the same affinity group.
Then I use the following script :
$vm1 = New-AzureVMConfig -Name $vmName -InstanceSize $vmSize -ImageName $imageName | Set-AzureSubnet "subnet-1" |
Add-AzureProvisioningConfig -Linux `
-LinuxUser $user `
-NoSSHPassword `
-SSHPublicKeys $sshkey
New-AzureVM -ServiceName $cloudservice `
-VMs $vm1 `
-ReservedIPName $cloudservice But the command return :
New-AzureVM : BadRequest: The virtual network name cannot be null or empty.
Do you have any idea about what's wrong here ?
Thanks.