0
votes

I want to read from google cloud storage using gsutil using a service credentials file. However I don't really understand how to pass it the permissions file. I have tried running "gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE" and then running "gsutil list". However I get the following output

You are attempting to perform an operation that requires a project id, with none configured. Please re-run gsutil config and make sure to follow the instructions for finding and entering your default project id.

After authenticating with gcloud should I be able to use gsutil

2

2 Answers

2
votes

Since you have done "gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE", the only thing you need to do is gcloud config set project <project id>

Note there's no -p option in gsutil

0
votes

Add -p <project id> at your gsutil command or perform a gcloud config set project <project id> to set the project ID globally.

You can also refer to this documentation for more gsutil arguments.