{"record":{"id":"96355e3518a01c51","repo":"BerriAI/litellm","slug":"missing-required-environment-variable-azure-stora","errorCode":null,"errorMessage":"Missing required environment variable: AZURE_STORAGE_ACCOUNT_NAME","messagePattern":"Missing required environment variable: AZURE_STORAGE_ACCOUNT_NAME","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/azure_storage/azure_storage.py","lineNumber":42,"sourceCode":"\nclass AzureBlobStorageLogger(CustomBatchLogger):\n    def __init__(\n        self,\n        **kwargs,\n    ):\n        try:\n            verbose_logger.debug(\"AzureBlobStorageLogger: in init azure blob storage logger\")\n\n            # Env Variables used for Azure Storage Authentication\n            self.tenant_id = os.getenv(\"AZURE_STORAGE_TENANT_ID\")\n            self.client_id = os.getenv(\"AZURE_STORAGE_CLIENT_ID\")\n            self.client_secret = os.getenv(\"AZURE_STORAGE_CLIENT_SECRET\")\n            self.azure_storage_account_key: str | None = os.getenv(\"AZURE_STORAGE_ACCOUNT_KEY\")\n\n            # Required Env Variables for Azure Storage\n            _azure_storage_account_name: Final = os.getenv(\"AZURE_STORAGE_ACCOUNT_NAME\")\n            if not _azure_storage_account_name:\n                raise ValueError(\"Missing required environment variable: AZURE_STORAGE_ACCOUNT_NAME\")\n            self.azure_storage_account_name: str = _azure_storage_account_name\n            _azure_storage_file_system: Final = os.getenv(\"AZURE_STORAGE_FILE_SYSTEM\")\n            if not _azure_storage_file_system:\n                raise ValueError(\"Missing required environment variable: AZURE_STORAGE_FILE_SYSTEM\")\n            self.azure_storage_file_system: str = _azure_storage_file_system\n            self.azure_storage_endpoint_suffix: str = (\n                os.getenv(\"AZURE_STORAGE_ENDPOINT_SUFFIX\") or AZURE_STORAGE_DEFAULT_ENDPOINT_SUFFIX\n            )\n            self._service_client = None\n            # Time that the azure service client expires, in order to reset the connection pool and keep it fresh\n            self._service_client_timeout: float | None = None\n\n            # Internal variables used for Token based authentication\n            self.azure_auth_token: str | None = None  # the Azure AD token to use for Azure Storage API requests\n            self.token_expiry: datetime | None = None  # the expiry time of the currentAzure AD token\n\n            asyncio.create_task(self.periodic_flush())\n            self.flush_lock = asyncio.Lock()","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/azure_storage/azure_storage.py#L24-L60","documentation":"AzureBlobStorageLogger reads its entire configuration from environment variables at construction; AZURE_STORAGE_ACCOUNT_NAME — the storage account hosting the ADLS Gen2 filesystem where logs are written — is mandatory with no constructor fallback and no default, so init fails immediately when it is absent. Note that only absence raises here: a typo'd account name passes init and fails later at request time.","triggerScenarios":"Enabling the azure_storage logger callback without provisioning/documented env; deploying the proxy to k8s with an incomplete ConfigMap/Secret; running locally with the vars in a .env that was never sourced; renaming the account without updating deployments.","commonSituations":"Teams set the auth vars (AZURE_STORAGE_ACCOUNT_KEY or the tenant/client trio) but forget the account name; multi-account subscriptions exporting the wrong one; CI pipelines that strip env.","solutions":["Export AZURE_STORAGE_ACCOUNT_NAME=<storage account name> (the dns prefix of https://<account>.dfs.core.windows.net)","Also set AZURE_STORAGE_FILE_SYSTEM — the very next check fires otherwise","Provide auth: either AZURE_STORAGE_ACCOUNT_KEY (key auth) or the AZURE_STORAGE_TENANT_ID / CLIENT_ID / CLIENT_SECRET trio (token auth)","Verify with `az storage account list -o table` that the name exists and is the intended account"],"exampleFix":"// before\nexport AZURE_STORAGE_ACCOUNT_KEY=...   # account name never set -> ValueError at init\n// after\nexport AZURE_STORAGE_ACCOUNT_NAME=\"mystgacct\"\nexport AZURE_STORAGE_FILE_SYSTEM=\"litellm-logs\"\nexport AZURE_STORAGE_ACCOUNT_KEY=...","handlingStrategy":"validation","validationCode":"import os\n\nfor var in (\"AZURE_STORAGE_ACCOUNT_NAME\", \"AZURE_STORAGE_FILE_SYSTEM\"):\n    if not os.getenv(var):\n        raise RuntimeError(f\"azure_storage logger disabled: {var} is not set\")\nauth = (os.getenv(\"AZURE_STORAGE_ACCOUNT_KEY\")\n        or all(os.getenv(v) for v in (\n            \"AZURE_STORAGE_TENANT_ID\", \"AZURE_STORAGE_CLIENT_ID\",\n            \"AZURE_STORAGE_CLIENT_SECRET\")))\nif not auth:\n    raise RuntimeError(\"azure_storage logger needs ACCOUNT_KEY or the tenant/client trio\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set account name and filesystem together — they are checked back-to-back","Provision the ADLS Gen2 filesystem (az storage fs create) before enabling the callback","Beware: a typo'd account name passes init and only fails at write time — validate the name against `az storage account list`","Keep the env block in one ConfigMap/Secret so partial mounts are impossible"],"tags":["azure-blob-storage","adls-gen2","litellm","logging","configuration","missing-env-var"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}