Repository navigation
Python: Azure OpenAI setting fix: Don't fetch AD token if API is present in environment variable. - #8985
Merged
Evan Mattson (moonbox3) merged 4 commits intoSep 25, 2024
Conversation
Contributor
Python Test Coverage ReportPython Unit Test Overview
|
Rob Emanuele (lossyrob)
force-pushed
the
fix/python-azure-openai-api-key-setting
branch
2 times, most recently
from
September 25, 2024 14:57
ae334d4 to
002ab11
Compare
Evan Mattson (moonbox3)
approved these changes
Sep 25, 2024
Evan Mattson (moonbox3)
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. We could add one unit test for azure_text_completion, but it isn't a blocker. Thanks for the fixes!
Evan Mattson (moonbox3)
approved these changes
Sep 25, 2024
Evan Mattson (moonbox3)
enabled auto-merge
September 25, 2024 15:12
Ben Thomas (alliscode)
approved these changes
Sep 25, 2024
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 25, 2024
Tao Chen (TaoChenOSU)
approved these changes
Sep 25, 2024
Rob Emanuele (lossyrob)
force-pushed
the
fix/python-azure-openai-api-key-setting
branch
from
September 25, 2024 15:52
0347673 to
1ee8f3a
Compare
Evan Mattson (moonbox3)
approved these changes
Sep 25, 2024
Rob Emanuele (lossyrob)
deleted the
fix/python-azure-openai-api-key-setting
branch
September 25, 2024 17:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
While working on #8951 I found that interacting with an Azure OpenAI instance I had an API key for, but my identity didn't have IAM access to the API for, that I was getting a permission error:
I found that this was because, though my API key was set in the environment, the codepath only recognized an explicitly passed in API key when deciding whether to issue an AD token while initializing an AzureTextEmbedding instance.
This PR fixes that by looking at the setting object explicitly, which may pull the API key from the environment.
Contribution Checklist