GCP Professional Cloud Architect Practice Question
Your organization's CI pipeline runs integration tests for a Go microservice that publishes to Cloud Pub/Sub, stores data in Firestore (Native mode), and queries Cloud Bigtable. A Docker test container starts local emulators for the three services on ports 8085, 8080, and 9000. The tests still fail because the Go client libraries exit with "could not find Application Default Credentials." Which single change will allow the tests to run entirely against the emulators without providing any credentials?
Run gcloud auth application-default login --no-launch-browser inside the container to create a dummy credential file after the emulators start.
Declare the environment variables PUBSUB_EMULATOR_HOST=localhost:8085, FIRESTORE_EMULATOR_HOST=localhost:8080, and BIGTABLE_EMULATOR_HOST=localhost:9000 before executing the test suite.
Execute gcloud config set auth/disable_credentials true in the container to tell every client library to ignore authentication.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to /dev/null so the libraries cannot find a credential file.
Google Cloud client libraries automatically bypass authentication when they detect the emulator-specific environment variables for a service. Setting PUBSUB_EMULATOR_HOST, FIRESTORE_EMULATOR_HOST, and BIGTABLE_EMULATOR_HOST to the localhost addresses of the running emulators causes each library to route traffic to the local endpoints and skip the Application Default Credentials lookup. The other options either leave the libraries expecting real credentials, disable authentication globally in unsupported ways, or still require generating a credential file inside the container.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why do Google Cloud client libraries skip authentication when environment variables for emulators are set?
Open an interactive chat with Bash
What are Application Default Credentials (ADC) in Google Cloud?
Open an interactive chat with Bash
How do Google Cloud emulators help in local testing?
Open an interactive chat with Bash
What are Application Default Credentials in Google Cloud?
Open an interactive chat with Bash
How do the emulator-specific environment variables work?
Open an interactive chat with Bash
What is the purpose of local emulators in Google Cloud?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Managing implementation
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .