code: func getPrimaryInterfaceID(machine compute.VirtualMachine) (string, error) {
  	if len(*machine.NetworkProfile.NetworkInterfaces) == 1 {
  		return *(*machine.NetworkProfile.NetworkInterfaces)[0].ID, nil
  	}
  
  	for _, ref := range *machine.NetworkProfile.NetworkInterfaces {
  		if *ref.Primary {
  			return *ref.ID, nil
  		}
  	}
  
  	return "", fmt.Errorf("failed to find a primary nic for the vm. vmname=%q", *machine.Name)
  }
docs: // This returns the full identifier of the primary NIC for the given VM.