【发布时间】:2020-01-22 10:31:35
【问题描述】:
要连接到存在于与 Google Cloud Function 不同的 GCP 项目中的 Google Cloud BigQuery,我将按如下方式创建 BigQuery 客户端:
const {BigQuery} = require('@google-cloud/bigquery');
const options = {
keyFilename: 'path/to/service_account.json',
projectId: 'my_project',
};
const bigquery = new BigQuery(options);
但我不想将 service_account.json 存储在我的 Cloud Function 中,而是将 Service Account 存储在 Google Cloud Storage 中,并在上面的 keyFilename 中提供 Google Cloud Storage 路径。如果可以提供谷歌云存储路径而不是本地路径,我找不到任何文档。
【问题讨论】:
标签: google-bigquery google-cloud-functions service-accounts google-cloud-iam