Hello!
I am trying to deploy an app with gcloud build submit and I am launching the command:
gcloud builds submit --substitutions _XXX=dev --project=dev-bbva-devops-metrics --config=cloudbuild.yaml --ignore-file=.gcloudignore --service-account=projects/XXXXX/serviceAccounts/XXXX@appspot.gserviceaccount.com
I use an appspot service account to read artifacts because this is the account which has permissions.
I have the next error and I am not able to fix it:
ERROR: (gcloud.builds.submit) PERMISSION_DENIED: generic::permission_denied: caller does not have permission to act as service account projects/XXX/serviceAccounts/XXXX. This command is authenticated as [MY_EMAIL] which is the active account specified by the [core/account] property
What could be a solution?
Hi @rakon92,
Welcome to the Google Cloud Community!
From the error message, it looks like your Appspot service account doesn’t have the necessary permissions to submit a Cloud Build. Here’s how you can grant Identity and Access Management (IAM) permissions to your Appspot service account:
To enable the role, go to the IAM page.
If the error persists, you can try this workaround:
You may also share your Cloud build logs here for more context and diagnosis.
I hope this helps!