nerdexam
Google

ASSOCIATE-CLOUD-ENGINEER · Question #228

You received a JSON file that contained a private key of a Service Account in order to get access to several resources in a Google Cloud project. You downloaded and installed the Cloud SDK and want to

The correct answer is B. Use the command gcloud auth activate-service-account and point it to the private key. Authorizing with a service account gcloud auth activate-service-account authorizes access using a service account. As with gcloud init and gcloud auth login, this command saves the service account credentials to the local system on successful completion and sets the specified acc

Submitted by eva_at· Mar 30, 2026Configuring access and security

Question

You received a JSON file that contained a private key of a Service Account in order to get access to several resources in a Google Cloud project. You downloaded and installed the Cloud SDK and want to use this private key for authentication and authorization when performing gcloud commands. What should you do?

Options

  • AUse the command gcloud auth login and point it to the private key
  • BUse the command gcloud auth activate-service-account and point it to the private key
  • CPlace the private key file in the installation directory of the Cloud SDK and rename it to
  • DPlace the private key file in your home directory and rename it to

How the community answered

(32 responses)
  • A
    3% (1)
  • B
    94% (30)
  • D
    3% (1)

Explanation

Authorizing with a service account gcloud auth activate-service-account authorizes access using a service account. As with gcloud init and gcloud auth login, this command saves the service account credentials to the local system on successful completion and sets the specified account as the active account in your Cloud SDK configuration. https://cloud.google.com/sdk/docs/authorizing#authorizing_with_a_service_account

Topics

#service accounts#gcloud CLI#authentication#private key

Community Discussion

No community discussion yet for this question.

Full ASSOCIATE-CLOUD-ENGINEER Practice