def append_cloud_repository_sources(function, context):
    """ Adds the source code from the cloud repository. """

    repo = context.properties.get('sourceRepository', {
        'url': context.properties.get('sourceRepositoryUrl')
    })
    function['properties']['sourceRepository'] = repo

    name = function['name']
    output = {
        'name': 'sourceRepositoryUrl',
        'value': '$(ref.{}.sourceRepository.deployedUrl)'.format(context.env['name'])
    }

    return [], [output]