How to use GCP service account in Google Cloud Function?

徘徊边缘 提交于 2020-03-05 03:54:06

问题


I have a Google Cloud Platform service account with domain-wide authority. I can add it to a Google Analytics API call from my terminal and it works correctly. However, I would like to run that same script as a Google Cloud Function and reference the service account in GCP without including the client_secret_service_account.json file (like below) in the repository or anywhere outside of GCP. Is that possible?

KEY_FILE_LOCATION = 'client_secret_service_account.json'

回答1:


You can now reference the service account when deploying Cloud Functions. Check documentation for gcloud.

When using GCP console, expand "Advanced options" to inform the service account



来源:https://stackoverflow.com/questions/55671256/how-to-use-gcp-service-account-in-google-cloud-function

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