Google Associate Cloud Engineer

Google Associate Cloud Engineer

Get started today

Ultimate access to all questions.


Your Python script, designed to connect to Google BigQuery from a Google Compute Engine virtual machine, is failing with connection errors. What steps should you take to resolve this issue?




Explanation:

The correct answer is B because, by default, a Google Compute Engine instance is associated with a default service account and default access scope, neither of which grants access to BigQuery. While using a service account with the appropriate IAM roles is recommended, the instance's access scopes must also be configured to allow OAuth authentication for API requests made through the gcloud tool and client libraries. Setting the full cloud-platform access scope on the instance and then limiting the service account's access via IAM roles is the best practice. Options A, C, and D are incorrect because they do not address the root cause of the connectivity issue, which is the lack of necessary access scopes on the instance.