
Explanation:
The correct command to authenticate access to Google Cloud Platform with a service account using its JSON key file is gcloud auth activate-service-account --key-file [KEY_FILE]. This command imports the service account credentials from the specified key file and activates them for use in gcloud. The other options either use incorrect syntax (authenticate instead of auth) or specify an incorrect action (service-account instead of activate-service-account). For more details, refer to the Google Cloud SDK documentation.
Ultimate access to all questions.
No comments yet.
You've developed an application that reads objects from a Google Cloud Storage bucket. Following GCP documentation, you created a service account with permissions limited to reading objects from the bucket. However, the application fails to read objects when using this service account. To troubleshoot, you plan to authenticate a gsutil session with the service account credentials to reproduce and identify the issue. What is the correct method to authenticate gsutil with service account credentials?
A
Create JSON keys for the service account and execute gcloud auth activate-service-account --key-file [KEY_FILE]
B
Create JSON keys for the service account and execute gcloud auth service-account --key-file [KEY_FILE]
C
Create JSON keys for the service account and execute gcloud authenticate service-account --key-file [KEY_FILE]
D
Create JSON keys for the service account and execute gcloud authenticate activate-service-account --key-file [KEY_FILE]