[英]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.我正在尝试创建一个计划 Cloud Function 导出我的 Firestore 数据库以创建备份。 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.
我已经发现我需要将“Storage Admin”和“Datastore Import Export Admin”添加到运行云时使用的服务帐户 function,但我无法弄清楚哪个服务帐户用于这些功能。
Does anyone know which service account is used?有谁知道使用哪个服务帐户?
Firebase Cloud Functions use the {project-id}@appspot.gserviceaccount.com
service account (App Engine default service account). Firebase Cloud Functions 使用
{project-id}@appspot.gserviceaccount.com
服务帐户(App Engine 默认服务帐户)。 Roles and permissions added to this service account carry over to the Cloud Functions runtime.添加到此服务帐户的角色和权限会转移到 Cloud Functions 运行时。
Good to know: When using Google Cloud Functions, the service account being used while running the function can be defined when deploying the function.很高兴知道:使用 Google Cloud Functions 时,可以在部署函数时定义运行函数时使用的服务帐户。
You can specify a custom service account with the runWith()
method if you prefer not to use the default one nowadays.如果您现在不想使用默认服务帐户,则可以使用
runWith()
方法指定自定义服务帐户。 It accepts a number of RuntimeOptions that can be defined.它接受许多可以定义的RuntimeOptions 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.