Easy1 markMultiple Choice
GCP ACE · Question 08 · Domain 1.3: Installing and configuring the CLI
You are working in the Cloud Shell and need to run several commands against a project with the ID 'my-company-analytics-123'. You want to avoid typing the project ID flag for every command.
Which command should you run FIRST?
You are working in the Cloud Shell and need to run several commands against a project with the ID 'my-company-analytics-123'. You want to avoid typing the project ID flag for every command.
Which command should you run FIRST?
Answer options:
A.
gcloud set project my-company-analytics-123
B.
gcloud config set project my-company-analytics-123
C.
gcloud projects set default my-company-analytics-123
D.
export GCP_PROJECT=my-company-analytics-123
How to approach this question
Recall the gcloud command used to modify local configuration properties.
Full Answer
B.gcloud config set project my-company-analytics-123✓ Correct
The `gcloud config set project [PROJECT_ID]` command sets the core/project property in your active configuration. Once set, any gcloud command that requires a project will automatically use this project ID unless overridden by the `--project` flag.
Common mistakes
Forgetting the `config` part of the command and just typing `gcloud set project`.
Practice the full GCP Associate Cloud Engineer Practice Exam 6
50 questions · hints · full answers · grading
More questions from this exam
Q01What is the primary purpose of a Google Cloud project?EasyQ02Your development team needs to manage Compute Engine instances in a specific project. They need t...MediumQ03You are automating the setup of a new Google Cloud project using a bash script. You need to enabl...EasyQ04Your startup has a strict monthly cloud budget of $500. You want to be notified immediately if yo...MediumQ05Your finance team wants to perform granular analysis of your Google Cloud spending using SQL. The...Hard
Expert