I have following permissions in google cloud.
I am creating a cloud run container using cloud repository. But getting following error.
ERROR: build step 2 "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" failed: step exited with non-zero status: 1 ERROR Finished Step #2 - "Deploy" Step #2 - "Deploy": ERROR: (gcloud.run.services.update) PERMISSION_DENIED: Permission 'run.services.get' denied on resource 'namespaces/buypower-mobile-app/services/test-repo' (or resource may not exist).
If you're using Cloud Build to deploy the Cloud Run service, then the error you’re getting is because the Service Account used by Cloud Build does not have sufficient permissions to update the Cloud Run service, according to the official documentation.
The specific error is that permission is denied on run.services.get
. This method is part of either roles/run.admin
or roles/run.developer
. Both roles include the permission run.services.update
, which it'll need.
To get it working, you will need to add that one of those roles to the Service Account that is being used by Cloud Build.