Developers typically use these fetches when they need to authenticate with other Google APIs (like Cloud Storage or BigQuery) without hardcoding secret keys. Using curl (Linux/VM):
Specifically, the decoded endpoint is:
/computeMetadata/v1/instance/service-accounts/default/token Result: A JSON object containing an access_token you can use in Authorization headers. Developers typically use these fetches when they need
The metadata server supports HTTP, not HTTPS. This is safe because it is a non-routable, link-local address. Developers typically use these fetches when they need
You can set custom metadata on your VM in the GCP Console and retrieve it via script, allowing you to configure applications without baking settings into the container image. Developers typically use these fetches when they need
"email": "your-service-account-email@your-project.iam.gserviceaccount.com", "aliases": [ "your-service-account-email@your-project.iam.gserviceaccount.com", "your-project:your-service-account-email" ], "scope": "https://www.googleapis.com/auth/cloud-platform"
So, why would you want to fetch this URL? Here are some use cases: