Cannot Deploy GCP Python Cloud Function

2k views Asked by At

I've been using GCP for some time.

I created a new GCP Project to test new functions, and enabled the Runtime API.

However, clicking Deploy pops up this message: "User does not have the 'iam.serviceAccounts.actAs' permission on [email protected] required to create the function. You can fix this by running gcloud iam service-accounts add-iam-policy-binding [email protected] --member=user: --role=roles/iam.serviceAccountUser"

I entered this into Shell, replacing with my Owner email for GCP. Still no luck ;(

1

There are 1 answers

4
SeungwooLee On BEST ANSWER

You have to add permissions that can use service account to your account.

According to Google document, A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs.

Seems that "[email protected]" is your service account runs cloud function.

The pop up message you received said that a user account running cloud function does not have 'iam.serviceAccounts.actAs' permission on that service account.

So you have to entered command in the message with replaced --member=user to --member=user:Your account email.

You can check your cloud function service account at details -> General information tab.

enter image description here