Skip to content

feat(azure): Make Azure AD scope configurable #11621

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 2 commits into from
Jun 15, 2025

Conversation

kjoth
Copy link
Contributor

@kjoth kjoth commented Jun 11, 2025

Previously, Azure scope had a hardcoded default value of "https://cognitiveservices.azure.com/.default" for Azure AD token generation. This commit makes the azure_scope parameter configurable by users.

Changes:

  • Updated initialize_azure_sdk_client to accept user-provided azure_scope parameter
  • Added azure_scope to all_litellm_params list to prevent it from being passed to API calls
  • Maintained backward compatibility by keeping the default value when no scope is provided
  • Updated test cases to accommodate the new configurable scope parameter

This allows users to specify custom scopes for Azure AD authentication while preventing the parameter from being passed to the Azure OpenAI API.

Title

Add configurable Azure AD scope parameter for authentication

Relevant issues

This PR is for the issue Make Azure AD scope a configurable parameter #9847

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
  • [ ✅ ] My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature

image
image

Changes

Previously, Azure scope had a hardcoded default value of "https://cognitiveservices.azure.com/.default" for Azure AD token generation. This commit makes the azure_scope parameter configurable by users.

Changes:
- Updated initialize_azure_sdk_client to accept user-provided azure_scope parameter
- Added azure_scope to all_litellm_params list to prevent it from being passed to API calls
- Maintained backward compatibility by keeping the default value when no scope is provided
- Updated test cases to accommodate the new configurable scope parameter

This allows users to specify custom scopes for Azure AD authentication while preventing the parameter from being passed to the Azure OpenAI API.
Copy link

vercel bot commented Jun 11, 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 Jun 12, 2025 10:57am

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krrishdholakia
Copy link
Contributor

Is this okay to merge? @kjoth @ishaan-jaff

@kjoth
Copy link
Contributor Author

kjoth commented Jun 15, 2025

Is this okay to merge? @kjoth @ishaan-jaff

@krrishdholakia Yes, it's good to merge. I've updated the docs as per @ishaan-jaff comments.

@krrishdholakia krrishdholakia merged commit ac4c29c into BerriAI:main Jun 15, 2025
6 checks passed
X4tar pushed a commit to X4tar/litellm that referenced this pull request Jun 17, 2025
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.

3 participants