GCP Application Credentials

Some of our jobs use Google Cloud Service Accounts for Authentication (GOOGLE_APPLICATION_CREDENTIALS env var). This is usually a file path: Getting started with authentication  |  Authentication  |  Google Cloud

Whats the best way to run a process this way with doppler? I’m thinking we can certainly store the json into an env var, but we’d need to write this to the filesystem before running the process unless you know of a better way.

Hi @avaitla16,

If you’re using a language-specific SDK, you should be able to pass in the JSON directly instead of using the env var file method.

Are you using a language SDK or the gcloud CLI?

Unfortunately we’re using a third party Quick Start - Maxwell's Daemon, which doesn’t have the ability to read from a json string (no special case for providing: Configurations.getGoogleCloudCredentials())

I ended up simply doing echo $GOOGLE_APPLICATION_CREDENTIALS_JSON > google_creds.json on startup.

Ok, thanks for replying back.

And just to confirm, is the echo $GOOGLE_APPLICATION_CREDENTIALS_JSON > google_creds.json code in a shell script that is being run by Doppler?

Yes exactly:

doppler run -- ./main.sh



/app/bin/maxwell ...

Great! Thanks for clarifying.