Closed DoctorMG closed 2 months ago
FYI: whwn I don't use the shell variable SERVICE_ACCOUNT and enter directly the account ID, than I don't get this problem.
The SERVICE_ACCOUNT
is a helper defined in Step 5 so you shouldn't need to hard code the value:
SERVICE_ACCOUNT=$(gcloud iam service-accounts list \
--filter cloudrun-serviceaccount --format "value(email)")
With any command that uses environment variables, confirm you've set the value by adding a echo
to the start of the command to confirm what will be run.
if I replay the codelab and enter the given line
gcloud secrets add-iam-policy-binding django_superuser_password \ --member serviceAccount:${SERVICE_ACCOUNT} \ --role roles/secretmanager.secretAccessor
I get as a result
gcloud secrets add-iam-policy-binding django_superuser_password --member serviceAccount:${SERVICE_ACCOUNT} --role roles/secretmanager.secretAccessor ERROR: (gcloud.secrets.add-iam-policy-binding) Status code: 400. Invalid service account ()..
Can anybody resolve this?