Skip to content

[Fixes] Azure OpenAI OIDC - allow using litellm defined params for OIDC Auth #10394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Apr 29, 2025

[Bug Fix] Azure OpenAI OIDC - allow using litellm defined params for OIDC Auth

Bug fix, using OIDC for auth to Azure, you needed to set the client and tenant id as env vars, litellm was not reading the vars defined on the config.yaml

How to repro

model_list:
  - model_name: gpt-4o
    litellm_params:
      model: azure/gpt-4o-2024-05-13
      api_base: https://xxxx.xxxx.xxxx/
      tenant_id: 72f988bf-86f1-41af-91ab-2d7cd011db47
      client_id: 00000000-0000-0000-0000-000000000000
      azure_ad_token: oidc/google/api://AzureADTokenExchange

Key changes

  • get_azure_ad_token_from_oidc() takes azure_client_id, azure_tenant_id.
  • litellm_params now accepted in Azure SDK client builders; values flow from AzureChatCompletion / AzureTextCompletion → BaseAzureLLM.initialize_azure_sdk_client.
  • order of checking params: dynamic parameters → environment → None.

Testing

Unit-test suite expanded to cover all paths.

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix
✅ Test

Changes

Copy link

vercel bot commented Apr 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2025 4:03am

@ishaan-jaff ishaan-jaff changed the title [Fixes] Azure OpenAI OIDC auth [Fixes] Azure OpenAI OIDC - allow using litellm defined params for OIDC Auth Apr 29, 2025
@ishaan-jaff ishaan-jaff merged commit eebb725 into main May 1, 2025
40 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant