How Can I Obtain GCP service account credentials on Google Cloud Run?

柔情痞子 提交于 2020-03-05 06:06:28

问题


This page explains both:

  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

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.


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/60033551/how-can-i-obtain-gcp-service-account-credentials-on-google-cloud-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!