{"record":{"id":"d16f15cc62154d4c","repo":"BerriAI/litellm","slug":"filesystem-self-azure-storage-file-system-does-n","errorCode":null,"errorMessage":"Filesystem {self.azure_storage_file_system} does not exist","messagePattern":"Filesystem (.+?) does not exist","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/files/azure_blob_storage_backend.py","lineNumber":262,"sourceCode":"            if self.azure_storage_account_key:\n                # Use Azure SDK (reuse logger's service client)\n                return await self._download_file_with_account_key(file_path)\n            else:\n                # Use REST API (reuse logger's token management)\n                return await self._download_file_with_azure_ad(file_path)\n\n        except Exception as e:\n            verbose_logger.exception(\"Error downloading file from Azure Blob Storage: %s\", e)\n            raise\n\n    async def _download_file_with_account_key(self, file_path: str) -> bytes:\n        \"\"\"Download file using Azure SDK with account key.\"\"\"\n        # Reuse the logger's service client method\n        service_client: Final = await self.get_service_client()\n        file_system_client: Final = service_client.get_file_system_client(file_system=self.azure_storage_file_system)\n        # Ensure filesystem exists (should already exist, but check for safety)\n        if not await file_system_client.exists():\n            raise ValueError(f\"Filesystem {self.azure_storage_file_system} does not exist\")\n        file_client: Final = file_system_client.get_file_client(file_path)\n        # Download file\n        download_response: Final = await file_client.download_file()\n        file_content: Final = await download_response.readall()\n        return file_content\n\n    async def _download_file_with_azure_ad(self, file_path: str) -> bytes:\n        \"\"\"Download file using REST API with Azure AD token.\"\"\"\n        # Reuse the logger's token management\n        await self.set_valid_azure_ad_token()\n\n        from litellm.constants import AZURE_STORAGE_MSFT_VERSION\n        from litellm.llms.custom_httpx.http_handler import (\n            get_async_httpx_client,\n            httpxSpecialProvider,\n        )\n\n        async_client: Final = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/base_llm/files/azure_blob_storage_backend.py#L244-L280","documentation":"Raised in _download_file_with_account_key when the Azure file system client (named by azure_storage_file_system, i.e. the container) reports exists() == False before download. Despite the 'Filesystem' wording this is the Azure container/filesystem configured for the backend; the code treats a missing container as an invalid state rather than auto-creating it.","triggerScenarios":"AZURE_STORAGE_FILE_SYSTEM (or equivalent config) names a container that was never created, was deleted, or is not visible with the account key used; typos in the container name; case mismatches (Azure container names are lowercase).","commonSituations":"New deployments where the storage account exists but the container was never provisioned; renaming containers without updating litellm env config; using the right container name against the wrong storage account (key from account A, container in account B).","solutions":["Create the container: az storage container create --account-name <acct> --name <filesystem> (or equivalent in the portal).","Verify AZURE_STORAGE_ACCOUNT_NAME matches the account whose key you configured — the container must live in that account.","Fix typos/case in AZURE_STORAGE_FILE_SYSTEM; Azure container names are lowercase, 3-63 chars.","Confirm the account key has list/read rights so exists() is not falsely negative due to authorization failures."],"exampleFix":"# before: container 'litellm-files' does not exist\nAZURE_STORAGE_FILE_SYSTEM=litellm-files\n\n# after\naz storage container create --account-name myacct --name litellm-files\n# then retry the file download","handlingStrategy":"validation","validationCode":"import os\nfrom azure.storage.blob import ContainerClient\n\ndef container_ready() -> bool:\n    client = ContainerClient.from_connection_string(\n        os.environ['AZURE_STORAGE_CONNECTION_STRING'],\n        container_name=os.environ['AZURE_STORAGE_FILE_SYSTEM'])\n    return client.exists()","typeGuard":null,"tryCatchPattern":"try:\n    content = await backend.download_file(storage_url)\nexcept ValueError as e:\n    if 'does not exist' in str(e):\n        provision_container()  # create + retry once\n    raise","preventionTips":["Provision containers in IaC (Terraform/Bicep) alongside storage accounts.","Run an exists() health check on startup in services using the storage backend.","Keep container names in lowercase and validate with Azure naming rules in config checks."],"tags":["azure","blob-storage","container","provisioning"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}