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
- Export AZURE_STORAGE_FILE_SYSTEM=<container-name> where the bare container/filesystem name is used (no slashes or URL)
- Confirm the container exists in the same storage account and is enabled for hierarchical namespace (ADLS Gen2) if you use that path style
- Set the auth variables (tenant/client id/secret or account key) if not already done
- 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
- Create the container before enabling the logger; the logger does not create it
- Keep account name + file system in the same env block/deployment spec
- If using ADLS Gen2, ensure hierarchical namespace is enabled on the account
- Run a startup check for all AZURE_STORAGE_* variables when the callback is on
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
- Missing required environment variable: AZURE_STORAGE_ACCOUNT
- AZURE_SENTINEL_DCR_IMMUTABLE_ID is required. Set it as an en
- AZURE_SENTINEL_ENDPOINT is required. Set it as an environmen
- AZURE_SENTINEL_TENANT_ID or AZURE_TENANT_ID is required. Set
- AZURE_SENTINEL_CLIENT_ID or AZURE_CLIENT_ID is required. Set
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/f8dd7dee9304899c.
Report an issue: GitHub.