0

I need a docker container being run by a google cloud run job to have access to the default credentials stored on the VM the container is spun up on but so far have been unable to do this.

Does anyone have any methods for doing this?

For context this is so I can run DBT and have it connect to BigQuery using the OAuth method.

SCQs
  • 43
  • 6

1 Answers1

1

To get a token, you need to make an http request to a special endpoint, http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token with the header Metadata-Flavor: Google set. Docs for the service identity are here.

Ben K
  • 344
  • 2
  • 5
  • This will not work. I cannot send a request from within the container that requires a user to do something with the response. The default credentials are already on the Cloud Run VM that spins up the container. I need the container to be able to access these default credentials from the VM. The auth method being used by dbt in this situation is oauth, not oauth-token – SCQs Apr 12 '23 at 14:40