BerriAI/litellm · error · ValueError

tenant_id, client_id, and client_secret must be provided

Error message

tenant_id, client_id, and client_secret must be provided

What it means

Error "tenant_id, client_id, and client_secret must be provided" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/azure/common_utils.py:122

    if client_id.startswith("os.environ/"):
        _client_id = get_secret_str(client_id)
    else:
        _client_id = client_id

    if client_secret.startswith("os.environ/"):
        _client_secret = get_secret_str(client_secret)
    else:
        _client_secret = client_secret

    verbose_logger.debug(
        "tenant_id=%s, client_id=%s, client_secret=[set=%s]",
        _tenant_id,
        _client_id,
        _client_secret is not None,
    )
    if _tenant_id is None or _client_id is None or _client_secret is None:
        raise ValueError("tenant_id, client_id, and client_secret must be provided")
    credential: Final = ClientSecretCredential(_tenant_id, _client_id, _client_secret)

    token_provider: Final = get_bearer_token_provider(credential, scope)

    verbose_logger.debug("token_provider %s", token_provider)

    return token_provider


def get_azure_ad_token_from_username_password(
    client_id: str,
    azure_username: str,
    azure_password: str,
    scope: str = "https://cognitiveservices.azure.com/.default",
) -> Callable[[], str]:
    """
    Get Azure AD token provider from `client_id`, `azure_username`, and `azure_password`

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Provide tenant_id, client_id, and client_secret for Azure AD authentication.

When it happens

Trigger: Thrown at litellm/llms/azure/common_utils.py:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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