Medium1 markMultiple Choice
GCP ACE · Question 07 · Domain 1.3: Installing and configuring the CLI
You are working in Cloud Shell and your current default project is set to 'dev-project-123'. You need to run several commands against resources in 'prod-project-999' without having to append the --project flag to every command.
Which command should you use to change your default project for the current session?
You are working in Cloud Shell and your current default project is set to 'dev-project-123'. You need to run several commands against resources in 'prod-project-999' without having to append the --project flag to every command.
Which command should you use to change your default project for the current session?
Answer options:
A.
gcloud set project prod-project-999
B.
gcloud config set project prod-project-999
C.
gcloud projects update prod-project-999 --default
D.
gcloud config update project prod-project-999
How to approach this question
Remember the structure for modifying local SDK properties: gcloud config set [PROPERTY] [VALUE].
Full Answer
B.gcloud config set project prod-project-999✓ Correct
The `gcloud config set` command is used to set properties in your active configuration. To change the default project, you use `gcloud config set project [PROJECT_ID]`.
Common mistakes
Forgetting the 'config' part of the command and guessing `gcloud set project`.
Practice the full GCP Associate Cloud Engineer Practice Exam 3
50 questions · hints · full answers · grading
More questions from this exam
Q01You are starting a new project in Google Cloud and need to create a new GCP project and enable th...EasyQ02A new team member has joined your operations team. They need to be able to view all Compute Engin...MediumQ03Your company is migrating to Google Cloud. You currently manage all employee identities in an on-...MediumQ04Your development team is experimenting with new GCP services in a sandbox project. The finance te...MediumQ05Your company wants to perform complex, custom SQL analysis on their Google Cloud billing data to ...Easy
Expert