简体   繁体   English

运行 Firebase Cloud Functions 时使用哪个服务帐户?

[英]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.

相关问题 使用 Firebase Cloud Functions 创建 Stripe Connect 帐户 - Creating a Stripe Connect account with Firebase Cloud Functions 当我使用服务帐户密钥初始化 firebase 时,部署 firebase 云 function 失败 - Deploying firebase cloud function fails when I initialise firebase with a service account key Express 应用程序是否始终在 Firebase Cloud Functions 中运行? - Is an express app always running in Firebase Cloud Functions? 从本地运行时如何更改 Google 服务帐户 v- Cloud Storage eclipse - How to change Google service account v- Cloud Storage when running from local eclipse 使用 Cloud Functions 中的服务帐户将数据从 GCS 上传到 Bigquery - Upload data from GCS to Bigquery using service account in Cloud Functions 在 GCP 云功能中添加跨项目服务帐户 - Adding cross project service account in GCP cloud functions 与 Firebase 函数一起使用时,Nodemailer 无法正常工作 - Nodemailer not working when used with Firebase Functions 在本地测试 Cloud Functions 时 Cloud Firestore 模拟器未运行 - Cloud Firestore emulator not running when testing Cloud Functions locally firebase中创建的云函数是否可以在不同的google开发者账户中使用? - Can the cloud functions created in firebase be used in different google developer accounts? Cloud Functions for Firebase 超时 - Cloud Functions for Firebase timeout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM