Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Associate Cloud Engineer All Questions

View all questions & answers for the Associate Cloud Engineer exam

Exam Associate Cloud Engineer topic 1 question 170 discussion

Actual exam question from Google's Associate Cloud Engineer
Question #: 170
Topic #: 1
[All Associate Cloud Engineer Questions]

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?

  • A. Use the command gcloud auth login and point it to the private key.
  • B. Use the command gcloud auth activate-service-account and point it to the private key.
  • C. Place the private key file in the installation directory of the Cloud SDK and rename it to ג€credentials.jsonג€.
  • D. Place the private key file in your home directory and rename it to ג€GOOGLE_APPLICATION_CREDENTIALSג€.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
GCP_Student1
Highly Voted 3 years, 8 months ago
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 account as the active account in your Cloud SDK configuration. https://cloud.google.com/sdk/docs/authorizing#authorizing_with_a_service_account
upvoted 44 times
...
TAvenger
Highly Voted 3 years, 8 months ago
B. gcloud auth activate-service-account --help NAME) gcloud auth activate-service-account - authorize access to Google Cloud Platform with a service account SYNOPSIS gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE [--password-file=PASSWORD_FILE | --prompt-for-password] [GCLOUD_WIDE_FLAG ...] DESCRIPTION To allow gcloud (and other tools in Cloud SDK) to use service account credentials to make requests, use this command to import these credentials from a file that contains a private authorization key, and activate them for use in gcloud. gcloud auth activate-service-account serves the same function as gcloud auth login but uses a service account rather than Google user credentials.
upvoted 20 times
eBooKz
1 year, 9 months ago
See below information suggesting that service account can be used to authorize with the command "gcloud auth login". Not sure if this is a recent update: "The gcloud auth login command authorizes access by using workload identity federation, which provides access to external workloads, or by using a service account key." "To activate your service account, run gcloud auth login with the --cred-file flag: gcloud auth login --cred-file=CONFIGURATION_OR_KEY_FILE Replace CONFIGURATION_OR_KEY_FILE with the path to one of the following: A credential configuration file for workload identity federation A service account key file" https://cloud.google.com/sdk/docs/authorizing#authorize_with_a_service_account
upvoted 1 times
itsimranmalik
1 year, 2 months ago
As per google - gcloud auth activate-service-account serves the same function as gcloud auth login but uses a service account rather than Google user credentials. Ref: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account
upvoted 1 times
...
...
...
yomi95
Most Recent 3 weeks, 6 days ago
Selected Answer: A
A works https://cloud.google.com/sdk/docs/authorizing#auth-login Check this sub menu: "Authorize a service account using a service account key"
upvoted 1 times
yomi95
3 weeks, 6 days ago
Correction, B also works, But for the question at hand, B seems to be more relatable. Question seems to be confusing.
upvoted 1 times
...
...
denno22
1 month, 3 weeks ago
Selected Answer: A
Authorize with a service account The gcloud auth login command can authorize access with a service account by using a credential file stored on your local file system. This credential can be a user credential with permission to impersonate the service account, a credential configuration file for workload identity federation, or a service account key. https://cloud.google.com/sdk/docs/authorizing#auth-login
upvoted 1 times
denno22
1 month, 2 weeks ago
Now, I see that while A works, B is a better answer.
upvoted 1 times
...
...
blackBeard33
9 months, 2 weeks ago
Selected Answer: B
The Answer is A. The command to use service account for authentication is precisely gcloud auth activate-service-account where you can point out to the key file using the flag --key-file. https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account
upvoted 2 times
...
Cynthia2023
10 months, 3 weeks ago
Selected Answer: B
• The command syntax is gcloud auth activate-service-account --key-file=PATH_TO_KEY_FILE, where PATH_TO_KEY_FILE is the path to the JSON file containing the service account's private key.
upvoted 1 times
...
scanner2
1 year, 2 months ago
Selected Answer: B
https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account
upvoted 2 times
...
N_A
1 year, 6 months ago
D. This method is for application default credentials. See: https://cloud.google.com/docs/authentication/application-default-credentials A. This method is to obtain credentials for a user account. C. This does nothing. Useless. B. Is the correct answer. See: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account
upvoted 3 times
...
Abhi00754
1 year, 7 months ago
Selected Answer: B
https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account B
upvoted 1 times
...
abirroy
2 years, 3 months ago
Selected Answer: B
Use the command gcloud auth activate-service-account and point it to the private key
upvoted 1 times
...
skrjha20
2 years, 4 months ago
ANswer is B To activate your service account, run gcloud auth activate-service-account: gcloud auth activate-service-account [ACCOUNT] --key-file=[KEY_FILE]
upvoted 1 times
...
AzureDP900
2 years, 5 months ago
I will go with B
upvoted 1 times
...
AzureDP900
2 years, 5 months ago
B is right Please refer https://cloud.google.com/storage/docs/authentication
upvoted 1 times
...
Rukman
2 years, 8 months ago
Selected Answer: B
Ans: B
upvoted 1 times
...
KunK
3 years, 2 months ago
B, really straightforward
upvoted 5 times
...
ravixkumar
3 years, 8 months ago
Ans : B gcloud auth activate-service-account --key-file=/test-service-account.json
upvoted 11 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...