def _process_disk_details(sub, disk):
    """Process disk record and yield them.

    Arguments:
        sub (Subscription): Azure subscription object.
        disk (dict): Raw disk record.

    Yields:
        dict: An Azure record of type ``disk``.

    """
    disk_type = 'unattached'
    if 'managed_by' in disk:
        if disk.get('managed_by'):
            disk_type = 'attached'

    record = {
        'raw': disk,
        'ext': {
            'cloud_type': 'azure',
            'record_type': 'disk',
            'disk_type': disk_type,
            'subscription_id': sub.get('subscription_id'),
            'subscription_name': sub.get('display_name'),
            'subscription_state': sub.get('state'),
        },
        'com': {
            'cloud_type': 'azure',
            'record_type': 'disk',
            'reference': disk.get('id')
        }
    }
    return record