BerriAI/litellm · error · ValueError
Invalid Azure Blob Storage URL format
Error message
Invalid Azure Blob Storage URL format: {storage_url} What it means
Error "Invalid Azure Blob Storage URL format: {storage_url}" thrown in BerriAI/litellm.
Solutions
- Fix the Azure Blob Storage URL format; it must match the expected account/container/blob pattern.
When it happens
Trigger: Thrown at litellm/llms/base_llm/files/azure_blob_storage_backend.py:242 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/3f4ae515c907195b.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/base_llm/files/azure_blob_storage_backend.py:242
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:
"""Download file using Azure SDK with account key."""
# Reuse the logger's service client method
service_client: Final = await self.get_service_client()
file_system_client: Final = service_client.get_file_system_client(file_system=self.azure_storage_file_system)
# Ensure filesystem exists (should already exist, but check for safety)View on GitHub (pinned to 77b7c6c40c)