Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to deploy a firebase cloud function due to permission error

I was trying to deploy my first firebase cloud function using firebase cli but I encountered an error instead :

C:\Users\Anurag Tripathi\Desktop\firebasecloudfunction> firebase deploy --only functions

Error: Missing permissions required for functions deploy. You must have permission iam.serviceAccounts.ActAs on service account  [email protected].

To address this error, ask a project Owner to assign your account the "Service Account User" role from this URL: 
        https://console.cloud.google.com/iam-admin/iam?project=project_number

I tried to solve the problem by following the instruction but didn't get any success . Please help.

Edit : I have abandoned the project :( , so I really can't test the answers. Thanks all for the answers and comments. I will accept the most upvoted answer.

like image 551
Anurag Tripathi Avatar asked May 12 '20 15:05

Anurag Tripathi


2 Answers

It turned out I had the wrong project name in the .firebaserc file. After changing the name to the correct google cloud project name it worked.

like image 88
D. Sackey Avatar answered Nov 15 '22 00:11

D. Sackey


As specified in the docs, apart from the Service Account User role, you should assign the Cloud Functions Admin role to the Service Account that you are using to deploy the functions

like image 41
Jose V Avatar answered Nov 14 '22 23:11

Jose V