Som*_*ame 1 bash service-accounts google-cloud-platform gcloud
I'm trying to authenticate in a bash script and enable my service account and I have cred.json. Here is what I tried:
gcloud auth activate-service-account --key-file=/etc/gcp-cred.json
Run Code Online (Sandbox Code Playgroud)
The problem is that I have to set project explicitly:
gcloud config set project my_proj
Run Code Online (Sandbox Code Playgroud)
Which is kind of redundant because gcp-cred.json contains this project already as a field:
"project_id": "my_proj"
Run Code Online (Sandbox Code Playgroud)
Is there a way to avoid doing gcloud config set project explicitly and set it with gcp-cred.json?