-
Notifications
You must be signed in to change notification settings - Fork 161
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
[Bug] Impersonating Service Account - Defaults GCP quota_project
to project where SA is defined
#1344
Comments
quota_project
to project where SA is definedquota_project
to project where SA is defined
@jcarpenter12 Thank you for opening this issue! I appreciate the level of detail you provided here and in the related PR. Would you be able to explain to me in what instances a user would need to impersonate a service account and also not use the related quota account? Is it due to access? |
Hi @amychen1776 thanks for getting back to me. This is actually a bit misleading this issue. It actually isn't related to impersonating a service account at all it applies when using any auth method as far as I can tell. I've raised this issue #1347 to cover that and will close this one as it's not the core problem |
## What are you changing in this pull request and why? <!-- Describe your changes and why you're making them. If related to an open issue or a pull request on dbt Core or another repository, then link to them here! To learn more about the writing conventions used in the dbt Labs docs, see the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md). --> References dbt-labs/dbt-bigquery#1343 dbt-labs/dbt-bigquery#1344 Adding docs to detail changes in PR dbt-labs/dbt-bigquery#1345 This adds detail about how to override the `quota_project` through the dbt profile. It also updates the information regarding the execution project. I believe that the execution project just sets where the BQ job is created and doesn't actually impact where it's billed from (I could be wrong on this, but from my testing I can see that the quota project is set from the environment not from the execution project override currently detailed in the docs). ## Checklist - [x] I have reviewed the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [ ] The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and/or [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content) guidelines. - [ ] I have added checklist item(s) to this list for anything anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch." <!-- PRE-RELEASE VERSION OF dbt (if so, uncomment): - [ ] Add a note to the prerelease version [Migration Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade) --> <!-- ADDING OR REMOVING PAGES (if so, uncomment): - [ ] Add/remove page in `website/sidebars.js` - [ ] Provide a unique filename for new pages - [ ] Add an entry for deleted pages in `website/vercel.json` - [ ] Run link testing locally with `npm run build` to update the links that point to deleted pages --> --------- Co-authored-by: Leona B. Campbell <[email protected]> Co-authored-by: Matt Shaver <[email protected]>
Is this a new bug in dbt-bigquery?
Current Behavior
When using the
impersonate_service_account
setting in theprofiles.yml
for BigQuery it will default thequota_project
for theclient_options
toNone
. It will then use the project that the service account is defined in as the quota project.This means that if the service account a user sets is defined in a project that does not have the BigQuery API enabled in it will fail, no matter what
execution_project
orproject
are set to in theprofiles.yml
as these are separate to the quota project.Expected Behavior
A user should be able to override and set the quota project in the configuration of the dbt profile rather than it defaulting to the project the service account is defined in. A user should not have to enable the BigQuery API for a project that a service account lives in if BigQuery is not required in that project.
Steps To Reproduce
pip install dbt-core==1.8.6 dbt-bigquery==1.8.2
MY_SERVICE_ACCOUNT_PROJECT:
dbt-sa
MY_DATA_PROJECT:
foo
within itroles/bigquery.dataViewer
to the datasetMY_EXECUTION_PROJECT:
roles/bigquery.jobUser
to the projectprofiles.yml
configuration that contains the following and substitute the names of your GCP projects with those you have created.profiles.yml
file defined abovedbt debug --connection --profiles-dir .
This will error on the connection and complain that the BQ API is not enabled in the project, it will link you to the project that the service account is defined in and crucially not the
project
orexecution_project
set in the profile.Relevant log output
Additional Context
This relates to a feature request I have also raised #1343 that outlines a solution/improvement that I think may work
The text was updated successfully, but these errors were encountered: