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?

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