.. versionadded:: 2015.8.0

    Creates the URL to access a blob

    CLI Example:

    .. code-block:: bash

        salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob

    container:
        Name of the container.
    blob:
        Name of the blob.
    account:
        Name of the storage account. If not specified, derives the host base
        from the provider configuration.
    protocol:
        Protocol to use: 'http' or 'https'. If not specified, derives the host
        base from the provider configuration.
    host_base:
        Live host base URL.  If not specified, derives the host base from the
        provider configuration.

def make_blob_url(kwargs=None, storage_conn=None, call=None):
    '''
    .. versionadded:: 2015.8.0

    Creates the URL to access a blob

    CLI Example:

    .. code-block:: bash

        salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob

    container:
        Name of the container.
    blob:
        Name of the blob.
    account:
        Name of the storage account. If not specified, derives the host base
        from the provider configuration.
    protocol:
        Protocol to use: 'http' or 'https'. If not specified, derives the host
        base from the provider configuration.
    host_base:
        Live host base URL.  If not specified, derives the host base from the
        provider configuration.
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The make_blob_url function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    if 'container' not in kwargs:
        raise SaltCloudSystemExit('A container name must be specified as "container"')

    if 'blob' not in kwargs:
        raise SaltCloudSystemExit('A blob name must be specified as "blob"')

    if not storage_conn:
        storage_conn = get_storage_conn(conn_kwargs=kwargs)

    data = storage_conn.make_blob_url(
        kwargs['container'],
        kwargs['blob'],
        kwargs.get('account', None),
        kwargs.get('protocol', None),
        kwargs.get('host_base', None),
    )
    ret = {}
    for item in data.containers:
        ret[item.name] = object_to_dict(item)
    return ret