部署定时云功能的业务帐号角色有哪些?



要部署我的Firebase项目,我已经设置了一个服务帐户,角色:

  • Cloud Functions Admin
  • 重火力点管理
  • 服务帐号用户

对于由Firestore或HTTPS触发的Hosting和Cloud Functions,它可以正常工作,但是对于一个预定的函数,它会失败。

我还需要什么额外的角色?

编辑:唯一相关的输出消息是:

i  functions: updating Node.js 14 function schedule-statistics(europe-west3)...
...
✔  functions[schedule-statistics(europe-west3)]: Successful update operation. 
...
Functions deploy had errors with the following functions:
schedule-statistics(europe-west3)

编辑:额外的测试:当在我的机器上使用我登录的CLI部署时,我看到这个额外的消息,当使用服务帐户部署时缺失:

✔  functions[schedule-statistics(europe-west3)]: Successful upsert schedule operation.

编辑:根据@Dharmaraj的建议添加日志,我可以看到缺失的权限:

The principal (user or service account) lacks IAM permission "cloudscheduler.jobs.get"
...
The principal (user or service account) lacks IAM permission "cloudscheduler.jobs.update"

所以当添加"云调度管理"时,它工作了!

我被误导了,因为我已经将此角色设置为服务帐户,但在中有另一个项目,它不传播!以牺牲一个美好的下午为代价的教训。

答案是:添加角色"云调度管理员"。
问题是:在一个项目中设置为服务帐户的角色不会传播到其他项目中的相同服务帐户。
好的教训是:添加--debug以查看额外的日志,包括缺失的权限,感谢@Dharmaraj

最新更新