BerriAI/litellm · error · ValueError
Invalid Azure Blob Storage URL
Error message
Invalid Azure Blob Storage URL: {storage_url} What it means
Error "Invalid Azure Blob Storage URL: {storage_url}" thrown in BerriAI/litellm.
Solutions
- Use a valid Azure Blob Storage URL (https://<account>.blob.core.windows.net/...).
When it happens
Trigger: Thrown at litellm/llms/base_llm/files/azure_blob_storage_backend.py:237 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/7d0df89fd9cc6a00.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/base_llm/files/azure_blob_storage_backend.py:237
)
response.raise_for_status()
async def download_file(self, storage_url: str) -> bytes:
"""
Download a file from Azure Blob Storage.
Args:
storage_url: Blob URL in format: https://{account}.blob.{endpoint_suffix}/{container}/{path}
Returns:
bytes: File content
"""
try:
# Parse blob URL to extract path
# URL format: https://{account}.blob.{endpoint_suffix}/{container}/{path}
parsed_url: Final = urlparse(storage_url)
if ".blob." not in (parsed_url.hostname or ""):
raise ValueError(f"Invalid Azure Blob Storage URL: {storage_url}")
# Extract path after container name
_, _, file_path = parsed_url.path.lstrip("/").partition("/")
if not file_path:
raise ValueError(f"Invalid Azure Blob Storage URL format: {storage_url}")
if self.azure_storage_account_key:
# Use Azure SDK (reuse logger's service client)
return await self._download_file_with_account_key(file_path)
else:
# Use REST API (reuse logger's token management)
return await self._download_file_with_azure_ad(file_path)
except Exception as e:
verbose_logger.exception("Error downloading file from Azure Blob Storage: %s", e)
raise
async def _download_file_with_account_key(self, file_path: str) -> bytes:View on GitHub (pinned to 77b7c6c40c)