运行Firebase Cloud Functions时使用哪个服务帐户? [英] Which service account is used when running Firebase Cloud Functions?

查看:42
本文介绍了运行Firebase Cloud Functions时使用哪个服务帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建日程表Cloud Function,以导出我的Firestore数据库以创建备份.在本地计算机(使用具有所有者角色的个人用户帐户)上投放代码时,代码运行正常,但一旦部署就会​​失败.我已经发现我需要在运行云功能时使用的服务帐户中添加存储管理员"和数据存储导入导出管理员",但是我无法确定该功能使用哪个服务帐户.

有人知道使用哪个服务帐户吗?

解决方案

Firebase Cloud Functions使用 {project-id} @ appspot.gserviceaccount.com 服务帐户(App Engine默认服务帐户).添加到该服务帐户的角色和权限会延续到Cloud Functions运行时.

要知道:使用Google 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?

解决方案

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.

这篇关于运行Firebase Cloud Functions时使用哪个服务帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆