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 #582: User Configurable OAuth Scopes in profiles.yml #641

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

stevenayers
Copy link
Contributor

@stevenayers stevenayers commented Apr 13, 2024

Resolves #582

Description

As @benc-db mentioned here, it could be worth adding user configurable options for oauth apps to profiles.

@benc-db adds oauth_redirect_url to profiles.yml in #638 but we also need to make oauth_scopes user-configurable.

Usage

Given the app connection:
Screenshot 2024-04-13 at 08 07 56

Profile configuration would be:

jaffle_shop:
  outputs:
    test:
      catalog: CATALOG
      host: WORKSPACE_URL
      http_path: /sql/1.0/warehouses/WAREHOUSE_ID
      schema: SCHEMA
      threads: 10
      auth_type: oauth
      oauth_redirect_url: "http://localhost:8050"
      oauth_scopes:
        - sql
        - offline_access
      type: databricks
  target: test

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

…plication.

Signed-off-by: Steven Ayers <steven@ayers.io>
Signed-off-by: Steven Ayers <steven@ayers.io>
@benc-db
Copy link
Collaborator

benc-db commented Apr 15, 2024

So, there's an issue that I'm trying to work through with the Databricks SDK folks where the scopes get overridden for Azure which is why I hadn't done this already, but if you can verify this fixes things for your AWS use-case, we can consider merging before that fix is ready.

If the OAuth application has only been configured with SQL access scopes or a custom redirect URL, you may need to update your profile accordingly:

``` YAML
jaffle_shop:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Appreciate you updating the readme :)

@stevenayers
Copy link
Contributor Author

So, there's an issue that I'm trying to work through with the Databricks SDK folks where the scopes get overridden for Azure which is why I hadn't done this already, but if you can verify this fixes things for your AWS use-case, we can consider merging before that fix is ready.

Ah I see. Well, for AWS it seems to be working well with just this fix. I'm pointing our requirements.txt to my fork on github for now, but would be great to have it merged in and released. 🙂

@benc-db benc-db merged commit a33829e into databricks:main Apr 15, 2024
21 checks passed
@stevenayers
Copy link
Contributor Author

Hi @benc-db, will this be released in v1.7.14 or will it come out in 1.8/2.0? 🚀

@benc-db
Copy link
Collaborator

benc-db commented May 1, 2024

Hi @benc-db, will this be released in v1.7.14 or will it come out in 1.8/2.0? 🚀

1.7.14, we just forgot to update the changelog.

@matthewchoy-envisso
Copy link

Would be good to add this to the docs!
Eg: https://docs.databricks.com/en/partners/prep/dbt.html

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.

[BUG] REDIRCT_URL mismatched with Databricks Cloud OAuth Application
3 participants