Closed
Closed
Feature
Copy link
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Engineneeds review[Status] The PR/issue is awaiting review from the maintainer[Status] The PR/issue is awaiting review from the maintainer
Description
Problem
When deploying ADK to Google Cloud, I must pass a .env file with these:
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_PROJECT=my-project
GOOGLE_CLOUD_LOCATION=us-central1
Proposal
This should not be needed when deploying to GCP:
GOOGLE_GENAI_USE_VERTEXAIshould be assumed to beTRUEunless an API key is provided.GOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONshould be retrieved from the instance metadata server.
A note on instance metadata server:
Every GCP runtime exposes the same instance metadata server which allows retrieving project and location. See reference for Cloud Run. It's trivial for ADK to query it (see example Go code)
Reacted by Marco Pellegrino and Marco Pellegrino
Metadata
Metadata
Assignees
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Engineneeds review[Status] The PR/issue is awaiting review from the maintainer[Status] The PR/issue is awaiting review from the maintainer
Activity
justingrayston commentedon Aug 22, 2025
I do agree we could have these as good standard defaults when running on Google cloud as long as we allow for override.
steren commentedon Aug 22, 2025
yes to be clear, I am only suggesting using this as a default behavior, the developer should still be able to customize project / location using .env
klateefa commentedon Nov 25, 2025
@steren Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.
a2105z commentedon Aug 13, 2026
Hi — I'd like to take this one on.
I'll add opt-in GCP metadata-server defaults for project/location (and Vertex usage) so Agent Engine / Cloud deploys don't require a
.envfor those values, while keeping explicit env/CLI overrides. Opening a PR shortly.@xuanyang15 please assign me (
@a2105z) if that helps with routing — I don't have self-assign permissions on this repo.a2105z commentedon Aug 13, 2026
PR ready for review: #6703
Implements metadata-server defaults for unset
GOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_LOCATION/ enterprise-Vertex mode on GCP (explicit.env/shell still wins).@xuanyang15 @steren @klateefa — would appreciate a look when you have bandwidth.
a2105z commentedon Aug 13, 2026
@xuanyang15 — PR is up for your review: #6703
DeanChensj commentedon Oct 14, 2026
Hi @steren, thank you for reporting this issue!
This has been resolved by PR #6703 and merged into the main branch in commit 8d8bbd2.
We are closing this issue as resolved. If you find that the issue persists on the latest ADK release or if this was closed in error, please feel free to reopen it or leave a comment! Thank you again for your contribution.
github-actions commentedon Oct 14, 2026
Are you satisfied with the resolution of your issue?
Yes
No