def _get_storage_account_name(storage_endpoint):
    """
    Determines storage account name from endpoint url string.
    e.g. 'https://mystorage.blob.core.windows.net' -> 'mystorage'
    """
    from six.moves.urllib.parse import urlparse
    return urlparse(storage_endpoint).netloc.split('.')[0]
