BerriAI/litellm · error · ValueError

Missing required environment variable: AZURE_STORAGE_FILE_SY

Error message

Missing required environment variable: AZURE_STORAGE_FILE_SYSTEM

What it means

Second hard requirement of AzureBlobStorageLogger: the file system (ADLS Gen2 container) name, read only from AZURE_STORAGE_FILE_SYSTEM. Checked immediately after the account name, so if you hit this error the account name was fine but the container name is missing. There is no constructor parameter; it must be in the environment.

Source

Thrown at litellm/integrations/azure_storage/azure_storage.py:46

        **kwargs,
    ):
        try:
            verbose_logger.debug("AzureBlobStorageLogger: in init azure blob storage logger")

            # Env Variables used for Azure Storage Authentication
            self.tenant_id = os.getenv("AZURE_STORAGE_TENANT_ID")
            self.client_id = os.getenv("AZURE_STORAGE_CLIENT_ID")
            self.client_secret = os.getenv("AZURE_STORAGE_CLIENT_SECRET")
            self.azure_storage_account_key: str | None = os.getenv("AZURE_STORAGE_ACCOUNT_KEY")

            # Required Env Variables for Azure Storage
            _azure_storage_account_name: Final = os.getenv("AZURE_STORAGE_ACCOUNT_NAME")
            if not _azure_storage_account_name:
                raise ValueError("Missing required environment variable: AZURE_STORAGE_ACCOUNT_NAME")
            self.azure_storage_account_name: str = _azure_storage_account_name
            _azure_storage_file_system: Final = os.getenv("AZURE_STORAGE_FILE_SYSTEM")
            if not _azure_storage_file_system:
                raise ValueError("Missing required environment variable: AZURE_STORAGE_FILE_SYSTEM")
            self.azure_storage_file_system: str = _azure_storage_file_system
            self.azure_storage_endpoint_suffix: str = (
                os.getenv("AZURE_STORAGE_ENDPOINT_SUFFIX") or AZURE_STORAGE_DEFAULT_ENDPOINT_SUFFIX
            )
            self._service_client = None
            # Time that the azure service client expires, in order to reset the connection pool and keep it fresh
            self._service_client_timeout: float | None = None

            # Internal variables used for Token based authentication
            self.azure_auth_token: str | None = None  # the Azure AD token to use for Azure Storage API requests
            self.token_expiry: datetime | None = None  # the expiry time of the currentAzure AD token

            asyncio.create_task(self.periodic_flush())
            self.flush_lock = asyncio.Lock()
            self.log_queue: list[StandardLoggingPayload] = []
            super().__init__(**kwargs, flush_lock=self.flush_lock)
        except Exception as e:
            verbose_logger.exception(

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Export AZURE_STORAGE_FILE_SYSTEM=<container-name> where the bare container/filesystem name is used (no slashes or URL)
  2. Confirm the container exists in the same storage account and is enabled for hierarchical namespace (ADLS Gen2) if you use that path style
  3. Set the auth variables (tenant/client id/secret or account key) if not already done
  4. Restart the proxy/process so the callback re-initializes

Example fix

# before
export AZURE_STORAGE_ACCOUNT_NAME=mystorageaccount
# AZURE_STORAGE_FILE_SYSTEM missing -> ValueError

# after
export AZURE_STORAGE_ACCOUNT_NAME=mystorageaccount
export AZURE_STORAGE_FILE_SYSTEM=litellm-logs
Defensive patterns

Strategy: validation

Validate before calling

import os

fs = os.getenv("AZURE_STORAGE_FILE_SYSTEM", "")
if not fs:
    raise RuntimeError("Missing required environment variable: AZURE_STORAGE_FILE_SYSTEM")
assert "/" not in fs, "use the bare container/filesystem name"

Type guard

def is_valid_file_system_name(v: str | None) -> bool:
    return isinstance(v, str) and v != "" and "/" not in v and len(v) >= 3

Try / catch

try:
    AzureBlobStorageLogger()
except ValueError as e:
    if "AZURE_STORAGE_FILE_SYSTEM" in str(e):
        raise SystemExit("Set AZURE_STORAGE_FILE_SYSTEM to the ADLS Gen2 container name") from e
    raise

Prevention

When it happens

Trigger: AZURE_STORAGE_ACCOUNT_NAME is set but AZURE_STORAGE_FILE_SYSTEM is not when the azure_storage callback initializes; container name misspelled or referencing a container that exists in a different account; empty-string value.

Common situations: Partial env setup (account configured, container forgotten); the container was created as a blob container instead of an ADLS Gen2 filesystem; renaming the container without updating env vars.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/f8dd7dee9304899c. Report an issue: GitHub.