如何在Google Cloud Run上获取GCP服务帐户凭据? [英] How Can I Obtain GCP service account credentials on Google Cloud Run?

查看:126
本文介绍了如何在Google Cloud Run上获取GCP服务帐户凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此页面解释了这两种情况:

This page explains both:

  1. 手动获取和提供服务帐户凭据,以便在本地开发,部署场所,或部署到另一个公共云.
  2. 在Compute Engine,Kubernetes Engine和App Engine环境中获取凭据
  1. Obtaining and providing service account credentials manually for developing local, deploying on-premises, or deploying to another public cloud.
  2. Obtaining credentials on Compute Engine, Kubernetes Engine, App Engine flexible environment, and Cloud Functions

但是没有提到在Cloud Run上获取凭证.如果您提供有关获取凭据以及在Cloud Run上设置firebase-admin initializeApp和firebase initializeApp进行身份验证的说明,我们将不胜感激.

But there is no mention of obtaining credentials on Cloud Run. I'd appreciate it if you give instructions for obtaining credentials and setting firebase-admin initializeApp and firebase initializeApp for authentication on Cloud Run.

推荐答案

文档建议您像

The documentation suggests that you can use the default service account just like other Google Cloud products as described here. The Firebase Admin SDK should use that account when initialized with no parameters.

如果您要使用非默认服务帐户,您可以简单地在控制台中配置它或随gcloud一起提供.

There are also steps described if you want to use a non-default service account, which you can simply configure in the console or provide with gcloud.

如果必须提供运行时可读的文件,则必须部署映像,并将该文件添加到映像中.添加文件没有简单的步骤-您必须使docker build包含在可读位置,并且您的代码将知道在哪里寻找该文件以进行加载.

If you must provide a file that's readable at runtime, you will have to deploy an image with that file added to the image. There is no short set of steps to add that file - you will have to make your docker build include it in a readable location, and your code will know where to look for it in order to load it.

这篇关于如何在Google Cloud Run上获取GCP服务帐户凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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