Accessing BigQuery from GCE

320 views
Skip to first unread message

Wogan May

unread,
Oct 11, 2017, 9:07:18 AM10/11/17
to gce-discussion
I'm trying to figure out why I can't use BigQuery from my GCE instance. 

Out of the box, I can use gsutil to explore my cloud storage, so I assumed that the shell was authenticating with the service account.

The bq tool doesn't work, though - if I try listing, it just dies with: BigQuery error in ls operation: Insufficient Permission

I've tried just about everything - including giving that service account project owner access, and sharing the dataset with it directly, but nothing seems to work.

Any ideas?

Digil (Google Cloud Platform Support)

unread,
Oct 11, 2017, 1:15:35 PM10/11/17
to gce-discussion

While creating the instance, under the “Identity and API access” you may have set “Allow default access” for ‘Access scopes’, which by default disable the BigQuery from accessing your VM [1].


You cannot set access scope while your instance is running. However, you can stop your instance and edit your scopes [2].


Also if you didn’t want stop your instance, you can always take the snapshot [3] of the running instance and create a new instance with this snapshot with ‘BiqQuery’ access enabled


[1] https://cloud.google.com/compute/docs/access/service-accounts#compute_engine_default_service_account

[2] https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes  

[3] https://cloud.google.com/compute/docs/disks/create-snapshots#create_your_snapshot

Wogan May

unread,
Oct 11, 2017, 4:20:53 PM10/11/17
to gce-discussion
Excellent, thanks for the feedback! I'll give that a try tomorrow.

Wogan May

unread,
Oct 16, 2017, 8:59:40 AM10/16/17
to gce-discussion
It worked! Thanks so much.
Reply all
Reply to author
Forward
0 new messages