BerriAI/litellm · error · ValueError

Azure OIDC provider failed: {e}

Error message

Azure OIDC provider failed: {e}

What it means

Error-mapping wrapper for the Azure OIDC path: an unexpected exception occurred while obtaining the Azure federated token (already logged via verbose_logger), and it is re-raised as a ValueError with the underlying error text for the caller.

Source

Thrown at litellm/secret_managers/main.py:288

            else:
                raise ValueError("Github OIDC provider failed")
        elif oidc_provider == "azure":
            # https://azure.github.io/azure-workload-identity/docs/quick-start.html
            azure_federated_token_file: Final = os.getenv("AZURE_FEDERATED_TOKEN_FILE")
            if azure_federated_token_file is None:
                verbose_logger.warning(
                    "AZURE_FEDERATED_TOKEN_FILE not found in environment will use Azure AD token provider"
                )
                azure_token_provider: Final = get_azure_ad_token_provider(azure_scope=oidc_aud)
                try:
                    oidc_token = azure_token_provider()
                    if oidc_token is None:
                        raise ValueError("Azure OIDC provider returned None token")
                    return oidc_token
                except Exception as e:
                    error_msg: Final = f"Azure OIDC provider failed: {e}"
                    verbose_logger.error(error_msg)
                    raise ValueError(error_msg)
            with open(azure_federated_token_file, "r") as f:
                oidc_token = f.read()
                return oidc_token
        elif oidc_provider == "file":
            # Load token from a file within an allowed credential directory.
            safe_path: Final = _resolve_oidc_file_path(oidc_aud)
            with open(safe_path, "r") as f:
                oidc_token = f.read()
                return oidc_token
        elif oidc_provider == "env":
            # Load token directly from an environment variable
            oidc_token = os.getenv(oidc_aud)
            if oidc_token is None:
                raise ValueError(f"Environment variable {oidc_aud} not found")
            return oidc_token
        elif oidc_provider == "env_path":
            # Load token from a file path specified in an environment variable
            token_file_path: Final = os.getenv(oidc_aud)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Inspect {e} from the Azure identity SDK; verify managed identity endpoint reachability and client id configuration.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/secret_managers/main.py:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/00d5f850733b98c8. Report an issue: GitHub.