How to add GOOGLE_APPLICATION_CREDENTIALS to fly's secret setting

Hello everyone, I encounter an interesting problem here:

GOOGLE_APPLICATION_CREDENTIALS is a json file, not a key-value set, how can I add this to fly’s secret setting?

Without knowing your development platform and application framework, I’ll make some assumptions. Adapt as necessary.

On MacOS, run the following command:

fly secrets set "GOOGLE_APPLICATION_CREDENTIALS=$(base64 -i /path/credentials.json)

Then create a small script:

#!/bin/bash -e
echo $GOOGLE_APPLICATION_CREDENTIALS | base64 -d > /var/run/credentials.json
exec "${@}"

Mark the script as executable, then and then add an ENTRYPOINT to your dockerfile naming this script.

1 Like

Thanks! I’m on Mac.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.