
Explanation:
Correct Answer: C
gcloud auth login command is designed for interactive user authentication, not for authenticating as a service account using a private key file.gcloud auth activate-service-account command is specifically designed to authenticate with Google Cloud services as a service account. By providing the path to the private key file, you can activate the service account for use with gcloud commands, enabling you to perform actions based on the service account's permissions.For more information, refer to the Google Cloud SDK documentation and authorization guide.
Ultimate access to all questions.
No comments yet.
At a game development company, your DevOps team has provided a JSON file containing the private key of a service account for local testing of a paid premium game version. This account has access to necessary GCP services. With the gcloud SDK installed on your laptop, how do you authenticate and authorize using the provided private key with gcloud commands?
A
Rename the private key file to GOOGLE_APPLICATION_CREDENTIALS and place it in your home directory.
B
Run the gcloud auth login command and point it to the private key.
C
Run the gcloud auth activate-service-account command and point it to the private key.
D
Rename the private key file to credentials.json and place it in the installation directory of the Cloud SDK.