2
votes

The deployment of your Cloud Function failed: Missing necessary permission resourcemanager.projects.getIamPolicy for [email protected] on resource projects/ourcafe-mucqxq. Please grant [email protected] the Cloud Functions Service Agent role. You can do that by running 'gcloud iam service-accounts add-iam-policy-binding projects/ourcafe-mucqxq --member=service-1044193269753@gcf-admin-robot.iam.gserviceaccount.com --role=Cloud Functions Service Agent'

I bumped into this problem in Dialogflow Fulfillment. However, I didn't know how to figure it out, did someone know how to do that?

This picture is IAM

This picture is Service Account

2
Your pictures are of the wrong service account. Reread the error message. You have this problem because you modified the Service Agent service account for Cloud Functions. Normally you do not need to modify this credential. Remember that for anything that has the words "Service Agent".John Hanley
Thanks a lot. Have already finish李宇澄
@李宇澄 did John Hanley's comment help you?aga

2 Answers

1
votes

I stumbled over the same message. It appears there's a typo in the gcloud command they give you: the role argument is missing the "roles/" prefix. This version worked for me:

gcloud projects add-iam-policy-binding ourcafe-mucqxq \
--member=serviceAccount:[email protected] \
--role=roles/cloudfunctions.serviceAgent
-1
votes

I feel like the answer is given to you. But I'm not sure. Have you tried running the command provided from the google cloud shell.

From your images the service account that is actually mentioned (service-1044193269753)does not have the role needed.

Read more on the Cloud functions service account here