{"record":{"id":"393ea53c7b339d46","repo":"BerriAI/litellm","slug":"azure-client-id-and-azure-tenant-id-must-be-set","errorCode":null,"errorMessage":"AZURE_CLIENT_ID and AZURE_TENANT_ID must be set","messagePattern":"AZURE_CLIENT_ID and AZURE_TENANT_ID must be set","errorType":"exception","errorClass":"AzureOpenAIError","httpStatus":422,"severity":"error","filePath":"litellm/llms/azure/common_utils.py","lineNumber":195,"sourceCode":"    \"\"\"\n    Get Azure AD token from OIDC token\n\n    Args:\n        azure_ad_token: str\n        azure_client_id: Optional[str]\n        azure_tenant_id: Optional[str]\n        scope: str\n\n    Returns:\n        `azure_ad_token_access_token` - str\n    \"\"\"\n    if scope is None:\n        scope = \"https://cognitiveservices.azure.com/.default\"\n    azure_authority_host: Final = os.getenv(\"AZURE_AUTHORITY_HOST\", \"https://login.microsoftonline.com\")\n    azure_client_id = azure_client_id or os.getenv(\"AZURE_CLIENT_ID\")\n    azure_tenant_id = azure_tenant_id or os.getenv(\"AZURE_TENANT_ID\")\n    if azure_client_id is None or azure_tenant_id is None:\n        raise AzureOpenAIError(\n            status_code=422,\n            message=\"AZURE_CLIENT_ID and AZURE_TENANT_ID must be set\",\n        )\n\n    oidc_token: Final = get_secret_str(azure_ad_token)\n\n    if oidc_token is None:\n        raise AzureOpenAIError(\n            status_code=401,\n            message=\"OIDC token could not be retrieved from secret manager.\",\n        )\n\n    azure_ad_token_cache_key: Final = json.dumps(\n        {\n            \"azure_client_id\": azure_client_id,\n            \"azure_tenant_id\": azure_tenant_id,\n            \"azure_authority_host\": azure_authority_host,\n            \"oidc_token\": oidc_token,","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/common_utils.py#L177-L213","documentation":"Error \"AZURE_CLIENT_ID and AZURE_TENANT_ID must be set\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/common_utils.py:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_CLIENT_ID and AZURE_TENANT_ID environment variables."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}