nerdexam
Google

PROFESSIONAL-CLOUD-ARCHITECT · Question #44

You write a Python script to connect to Google BigQuery from a Google Compute Engine virtual machine. The script is printing errors that it cannot connect to BigQuery. What should you do to fix the…

The correct answer is C. Create a new service account with BigQuery access and execute your script with that user. Access scopes are legacy/pre IAM way of giving permissions where as custom service accounts are recommended now. The Service Account ACCESS SCOPES are the Legacy methods of specifying permissions for your instance and they are used in substitutions of IAM roles. They you used…

Submitted by wei.xz· Mar 30, 2026Designing for security and compliance

Question

You write a Python script to connect to Google BigQuery from a Google Compute Engine virtual machine. The script is printing errors that it cannot connect to BigQuery. What should you do to fix the script?

Options

  • AInstall the latest BigQuery API client library for Python
  • BRun your script on a new virtual machine with the BigQuery access scope enabled
  • CCreate a new service account with BigQuery access and execute your script with that user
  • DInstall the bq component for gccloud with the command gcloud components install bq.

How the community answered

(38 responses)
  • A
    5% (2)
  • C
    92% (35)
  • D
    3% (1)

Explanation

Access scopes are legacy/pre IAM way of giving permissions where as custom service accounts are recommended now. The Service Account ACCESS SCOPES are the Legacy methods of specifying permissions for your instance and they are used in substitutions of IAM roles. They you used specifically for default or automatically created service accounts based on enabled APIs. Before the existence of IAM roles the Access Scopes were the only way for granting permissions to the service accounts , although they are not the primary way of granting permissions now , you must still set service account access scopes when configuring an instance to run as a service account. However when you are using a custom service account you will not be using access scopes rather you will be using IAM Roles. So when you are using a default Service Account for your compute Instance it will default to use scopes instead of IAM roles.

Topics

#service accounts#IAM#BigQuery access#Compute Engine

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-ARCHITECT Practice