Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which service account is used when running Firebase Cloud Functions?

I'm trying to create a schedule Cloud Function exporting my Firestore database to create backups. The code is running fine when serving on my local machine (which uses my personal user account with owner role) but failes once deployed. I already found out that I need to add the 'Storage Admin' and 'Datastore Import Export Admin' to the service account used when running the cloud function, but I can't figure out which service account is used for the functions.

Does anyone know which service account is used?

like image 939
crysxd Avatar asked Jun 16 '19 11:06

crysxd


People also ask

Which service account does cloud function use?

At runtime, Cloud Functions defaults to using the App Engine default service account ( [email protected] ), which has the Editor role on the project.


1 Answers

Firebase Cloud Functions use the {project-id}@appspot.gserviceaccount.com service account (App Engine default service account). Roles and permissions added to this service account carry over to the Cloud Functions runtime.

Good to know: When using Google Cloud Functions, the service account being used while running the function can be defined when deploying the function.

like image 158
crysxd Avatar answered Oct 04 '22 03:10

crysxd