Google ACE Setting Up a Cloud Solution Environment Practice Question
A developer wants to use gcloud CLI with application default credentials (ADC) to authenticate to Google APIs from their local machine. Which command should they run first?
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 auth application-default login
gcloud auth application-default login sets up ADC for the user. This stores credentials that can be used by Google client libraries.
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 obtains OAuth credentials for the gcloud CLI itself, storing them in the user's home directory for use by gcloud commands. It does not write the application_default_credentials.json file that client libraries and ADC-aware tools look for, so ADC remains unconfigured even after a successful login.
- ✗
gcloud init
Why it's wrong here
gcloud init performs SDK initialization: it creates a configuration, sets the project, and may prompt for account login, but it never provisions Application Default Credentials. Its purpose is to prepare the gcloud environment, not to create the dedicated ADC credential file that client libraries require for implicit authentication.
- ✓
gcloud auth application-default login
Why this is correct
gcloud auth application-default login is the correct command because it explicitly generates Application Default Credentials, storing them in the standard location (typically ~/.config/gcloud/application_default_credentials.json). These credentials are then picked up automatically by Google Cloud client libraries when no explicit service account key is supplied, enabling local development to use your user account's permissions as ADC.
- ✗
gcloud config set auth/application_default true
Why it's wrong here
gcloud config set auth/application_default true is invalid because no such configuration property exists in the gcloud SDK. The gcloud config set command only modifies SDK properties like project or region; it cannot create, enable, or store Application Default Credentials, and this command would return an error about the unrecognized property.
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
gcloud CLI
The gcloud CLI is a command-line tool that lets you manage Google Cloud resources by typing commands instead of clicking through a web interface.
About these practice questions
This ACE question is part of Courseiva's 769-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.