Google ACE Setting Up a Cloud Solution Environment Practice Question
A new engineer wants to set up their local environment to interact with Google Cloud. Which command initializes the gcloud CLI and configures the project, region, and zone?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud init
The 'gcloud init' command initializes the SDK, sets default project, region, and zone interactively. 'gcloud auth login' only handles authentication. 'gcloud config set' sets individual properties but doesn't initialize. 'gcloud auth application-default login' is for application default credentials.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gcloud auth login
Why it's wrong here
gcloud auth login only completes the authentication half of local setup: it launches a browser flow to obtain user credentials and stores them in the active gcloud configuration. It does not create a configuration, prompt for a default project, or set compute/region and compute/zone properties. Consequently, subsequent commands may fail or behave unpredictably because they lack the project and location context that gcloud init normally establishes.
- ✗
gcloud auth application-default login
Why it's wrong here
gcloud auth application-default login is designed for Application Default Credentials (ADC), which are consumed by client libraries and the Google Cloud SDK's API client libraries, not by the gcloud command-line tool itself. It writes credentials to the well-known ADC location (typically ~/.config/gcloud/application_default_credentials.json) and does not modify the active config's project or set regional/zone defaults. This command is therefore a prerequisite for local development with client libraries, not a substitute for gcloud init's broader environment initialization.
- ✓
gcloud init
Why this is correct
gcloud init is the correct command because it performs a complete guided initialization of the local gcloud environment: it authenticates using either a user account or service account, sets a default project, and optionally configures compute/region and compute/zone properties in a new or existing configuration. It also runs an initial diagnostic to verify the installation and, if needed, can re-initialize an existing configuration. This one command provides the foundational project and location context that other gcloud commands depend on.
- ✗
gcloud config set project my-project
Why it's wrong here
gcloud config set project my-project only mutates a single property in the active gcloud configuration, namely the project value, without authenticating the user or establishing default region or zone settings. It is a low-level property setter, not an environment initializer; if you run it immediately after installing gcloud, you will still lack authenticated credentials and may have no active configuration at all. While it can be part of a manual setup, it does not cover the authentication and regional defaults that gcloud init sets during its interactive workflow.
Go deeper
Related to this question
Learn chapter
Google Cloud Platform Overview
Key term
Application Default Credentials
Application Default Credentials (ADC) is a built-in Google Cloud mechanism that automatically finds and provides the right credentials for your application to authenticate to Google Cloud services without hardcoding secrets.
Key term
Google Cloud
Google Cloud is a suite of cloud computing services offered by Google that provides infrastructure, platform, and software solutions over the internet.
About these practice questions
Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.