def get_vm_ips(nm_client, resource_group, vm_name):
    """
    Get the private and public IP addresses for a given virtual machine.
    If a virtual machine has the more than one IP address of each type, then
    only the first one (as determined by the Azure SDK) is returned.

    This function returns the following tuple: (private IP, public IP)

    If a given VM does not have a private or public IP address, its tuple
    entry will be None.
    """
    for nif in nm_client.network_interfaces.list(resource_group):
        if vm_name in nif.name:
            ipc = nif.ip_configurations[0]
            pub_ip = ipc.public_ip_address
            if pub_ip:
                pub_ip = pub_ip.ip_address
            return (ipc.private_ip_address, pub_ip)
    return (None, None)