- A
The GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to a JSON key file
Why wrong: ADC checks GOOGLE_APPLICATION_CREDENTIALS first — but if it's not set, ADC falls back to the instance metadata service on GCE, using the attached service account.
- B
The VM's attached service account credentials via the instance metadata server
ADC on GCE automatically uses the service account attached to the VM through the instance metadata server (metadata.google.internal/computeMetadata/v1/instance/service-accounts/) — no key file needed.
- C
The developer's personal Google account used during `gcloud auth login`
Why wrong: ADC in a CI/CD pipeline on a GCE VM uses the instance's service account — developer credentials from `gcloud auth login` are CLI-specific and not used by ADC in production environments.
- D
A randomly selected service account from the project's service accounts list
Why wrong: ADC uses the service account specifically attached to the VM instance — not a random service account from the project.
Quick Answer
The answer is the VM's attached service account credentials via the instance metadata server. This is correct because Application Default Credentials (ADC) on a Google Compute Engine VM follows a specific credential lookup chain: when no environment variable like GOOGLE_APPLICATION_CREDENTIALS is set, ADC automatically contacts the link-local metadata server at 169.254.169.254 to retrieve a temporary access token for the service account attached to the VM. On the Google Associate Cloud Engineer exam, this concept tests your understanding of how GCP handles authentication for compute workloads without manual key management. A common trap is assuming ADC uses a JSON key file by default, but on GCE VMs it always prefers the metadata server. Remember the memory tip: "No env var? Hit the metadata server at 169.254.169.254" — that link-local address is the key to automatic, secure authentication on GCE.
Google ACE Setting up a cloud solution environment Practice Question
This ACE practice question tests your understanding of setting up a cloud solution environment. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A team's CI/CD pipeline authenticates to GCP using Application Default Credentials (ADC). The pipeline runs on a GCE VM with a service account attached. Which credential source does the ADC use when running on a GCE VM?
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
The VM's attached service account credentials via the instance metadata server
On a GCE VM, Application Default Credentials (ADC) automatically uses the credentials from the VM's attached service account by querying the instance metadata server at the link-local address 169.254.169.254. This is the default behavior when no environment variable or other credential source is explicitly configured, making option B correct.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to a JSON key file
Why it's wrong here
ADC checks GOOGLE_APPLICATION_CREDENTIALS first — but if it's not set, ADC falls back to the instance metadata service on GCE, using the attached service account.
- ✓
The VM's attached service account credentials via the instance metadata server
Why this is correct
ADC on GCE automatically uses the service account attached to the VM through the instance metadata server (metadata.google.internal/computeMetadata/v1/instance/service-accounts/) — no key file needed.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
The developer's personal Google account used during `gcloud auth login`
Why it's wrong here
ADC in a CI/CD pipeline on a GCE VM uses the instance's service account — developer credentials from `gcloud auth login` are CLI-specific and not used by ADC in production environments.
- ✗
A randomly selected service account from the project's service accounts list
Why it's wrong here
ADC uses the service account specifically attached to the VM instance — not a random service account from the project.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the misconception that ADC always requires an explicit credential file or that it uses the gcloud user login, when in fact on GCE VMs it transparently uses the attached service account via the metadata server.
Detailed technical explanation
How to think about this question
ADC follows a well-defined order of precedence: it first checks the GOOGLE_APPLICATION_CREDENTIALS environment variable, then the gcloud CLI default credentials (for local development), then the instance metadata server on GCE and GAE, and finally the attached service account on GKE. On a GCE VM, the metadata server exposes the service account's access token via the endpoint `computeMetadata/v1/instance/service-accounts/default/token`, which ADC uses to authenticate API calls without requiring any explicit key file.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Setting up a cloud solution environment — study guide chapter
Learn the concepts, then practise the questions
- →
Setting up a cloud solution environment practice questions
Targeted practice on this topic area only
- →
All ACE questions
500 questions across all exam domains
- →
Google Associate Cloud Engineer study guide
Full concept coverage aligned to exam objectives
- →
ACE practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related ACE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Setting up a cloud solution environment practice questions
Practise ACE questions linked to Setting up a cloud solution environment.
Planning and configuring a cloud solution practice questions
Practise ACE questions linked to Planning and configuring a cloud solution.
Deploying and implementing a cloud solution practice questions
Practise ACE questions linked to Deploying and implementing a cloud solution.
Ensuring successful operation of a cloud solution practice questions
Practise ACE questions linked to Ensuring successful operation of a cloud solution.
Configuring access and security practice questions
Practise ACE questions linked to Configuring access and security.
ACE fundamentals practice questions
Practise ACE questions linked to ACE fundamentals.
ACE scenario practice questions
Practise ACE questions linked to ACE scenario.
ACE troubleshooting practice questions
Practise ACE questions linked to ACE troubleshooting.
Practice this exam
Start a free ACE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this ACE question test?
Setting up a cloud solution environment — This question tests Setting up a cloud solution environment — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The VM's attached service account credentials via the instance metadata server — On a GCE VM, Application Default Credentials (ADC) automatically uses the credentials from the VM's attached service account by querying the instance metadata server at the link-local address 169.254.169.254. This is the default behavior when no environment variable or other credential source is explicitly configured, making option B correct.
What should I do if I get this ACE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.