Skip to content
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

Fix scopes in OAuthClient with using model serving on Azure #599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sdonohoo-db
Copy link

Changes

If the application instantiating an instance of OAuthClient is using Azure, full access to Azure Databricks is required. So the scope list must include '{effective_azure_login_app_id}/user_impersonation' and 'offline_access'. However, the scopes were set to these instead of appending to any existing scopes that may be been in the list. In the case of calling a model serving endpoint, scope 'all-apis' is also needed.

Changed the line to append the additional Azure-required scopes if not already present in the list rather than set.

Tests

Tested using https://github.com/sdonohoo-db/model-serving-oauth/blob/main/U2M/flask_app_with_oauth.py sample client adapted from https://github.com/databricks/databricks-sdk-py/blob/main/examples/flask_app_with_oauth.py to demonstrate using U2M OAuth with model serving.

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

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