set correct project when using from_service_account_json
See original GitHub issueWhen instantiating with bigquery.Client.from_service_account_json('...') the project field in the client should be set to the project_id defined in the service account JSON.
Right now it is still the one from env.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (14 by maintainers)
Top Results From Across the Web
Create and manage service account keys - IAM - Google Cloud
In the Google Cloud console, go to the Service accounts page. · Select a project. · Click the email address of the service...
Read more >gcloud auth activate-service-account from JSON to set current ...
I can see that, but my question is how to how to set the active project from that JSON file. I can't use...
Read more >How to run gcloud command line using a service account
Create a service account with GCP console · Download the json key file · Create a role and assign proper required permissions to...
Read more >Service Accounts | Google Earth Engine
Once you have a service account, click the menu for that account (more_vert), then Create key > JSON. Download the JSON key file....
Read more >How to create a Google Cloud Service Account and download ...
In this video, I am going to show you how to create a Google Cloud Service account and download the Cloud Service client...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I ran into this issue when attempting to switch from the more manual
googleapiclientto this library.Using
googleapiclient:Using
google.cloud:As pointed out in this thread, if we manually specify the
projectargument toClientin the latter example it will work. Dunno how relevant this comparison is, but the difference in default behaviour took me a while to figure out.If the project ID isn’t in the JSON file, then they manually deleted it… I don’t think that’s a common thing…