Creating multiple azure vms in different subnets

I trying to create 4 azure windows vms in to a existing vnet with two subnets.out of 4 vms three will be in one subnet and one vm in another subnet.im using data module to get details of existing subnets.can someone suggest what logic i can use to get nic placed in different subnet according to hostname of vms