According to a few examples, gsutil configuration can be used to create GCS-compatible .boto files from OAuth2 credentials for service accounts.
For example, https://cloud.google.com/storage/docs/xml-api/gspythonlibrary offers a service account credential that you should use gsutil config -e to configure the .boto file; however, when I run this command, I get:
CommandException: OAuth2 is the preferred authentication mechanism with the Cloud SDK. Run "gcloud auth login" to configure authentication, unless you want to authenticate with an HMAC access key and secret, in which case run "gsutil config -a".
Following the instructions, I am trying to use gcloud auth activate-service-account:
$ gcloud auth activate-service-account --key-file=/Users/crschmidt/mirandum-local/cloud-storage-service.json Activated service account credentials for: [ gcs-storage@livestream-alerts.iam.gserviceaccount.com ]
But this does not create a .boto file.
I can set up a compatible HMAC project ID / secret in compatibility mode and use it, but since the OAuth2 credentials are preferred and the service account credentials seem to be correct, I'm not sure how to proceed. How to write a .boto file for a service account?
crschmidt-macbookair:~ crschmidt$ gsutil --version gsutil version: 4.19
source share