Google cloud platform 如何使用json服务凭据读取google云存储桶

Google cloud platform 如何使用json服务凭据读取google云存储桶,google-cloud-platform,google-cloud-storage,Google Cloud Platform,Google Cloud Storage,我想使用gsutil和服务凭证文件从google云存储中读取数据。 但是,我真的不明白如何将权限文件传递给它。 我试过跑步 “gcloud auth activate服务帐户[帐户]--密钥文件=密钥文件” 然后运行“gsutil列表”。但是,我得到以下输出 You are attempting to perform an operation that requires a project id, with none configured. Please re-run gsutil config

我想使用gsutil和服务凭证文件从google云存储中读取数据。 但是,我真的不明白如何将权限文件传递给它。 我试过跑步 “gcloud auth activate服务帐户[帐户]--密钥文件=密钥文件” 然后运行“gsutil列表”。但是,我得到以下输出

You are attempting to perform an operation that requires a project id, with none configured. Please re-run gsutil config and make sure to follow the instructions for finding and entering your default project id.
在使用gcloud进行身份验证后,我应该能够在您的
gsutil
命令中使用gsutil

添加
-p
,或者执行
gcloud config set project
全局设置项目ID

您还可以参考以获取更多的gsutil参数。

gsutil
命令中添加
-p
,或执行
gcloud config set project
以全局设置项目ID

您还可以参考以获取更多gsutil参数。

因为您已经完成了
“gcloud auth activate service account[account]--key file=key\u file”
,所以您只需要做
gcloud config set project

注意,
gsutil

中没有
-p
选项,因为您已经完成了
“gcloud auth activate service account[account]--key file=key_file”
,您只需要做
gcloud config set项目


注意,
gsutil

中没有
-p
选项,
gsutil
中没有
-p
选项,但是
gsutil ls
命令有一个
-p
。有关
gsutil ls
命令的更多信息,请参阅本文档。如何在生产时访问服务凭据json?在
gsutil
中没有
-p
选项,但对于
gsutil ls
命令有一个
-p
。有关
gsutil ls
命令的更多信息,请参阅本文档。我们如何在生产环境中访问服务凭据?