Medium1 markMultiple Choice

GCP ACE · Question 07 · Domain 1.3: Installing and configuring the CLI

You are working in Cloud Shell and need to execute several commands against a project named 'analytics-prod-992'. Your current default project is set to 'web-dev-123'.

Which command should you use to change the default project for your current active configuration?

Answer options:

A.

gcloud config set project analytics-prod-992

B.

gcloud projects update analytics-prod-992

C.

gcloud switch project analytics-prod-992

D.

export GCP_PROJECT=analytics-prod-992

How to approach this question

Remember that local CLI settings (like default project, zone, region) are managed using the 'gcloud config set' command.

Full Answer

A.gcloud config set project analytics-prod-992✓ Correct
gcloud config set project analytics-prod-992
To change the default project in your active Cloud SDK configuration, you use `gcloud config set project [PROJECT_ID]`. This ensures that subsequent gcloud commands will target 'analytics-prod-992' without needing to append the `--project` flag to every command.

Common mistakes

Confusing project management commands (`gcloud projects`) with CLI configuration commands (`gcloud config`).

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam