【问题标题】:How to run gcloud command using given configuration of a service account如何使用给定的服务帐户配置运行 gcloud 命令
【发布时间】:2019-05-20 11:26:11
【问题描述】:

我有几个 gcloud 服务帐户,我想将它们添加到 gcloud config configurations list。根据我在他们的doc 上可以找到的内容,我可以使用命令gcloud config configurations create <config-name> 创建不同的配置。然后我做了以下操作将服务帐户添加到我的配置列表中

gcloud config configurations activate <config-name>
gcloud config set account <service-account-email>
gcloud config configurations activate default

似乎一切都很好。但是当我尝试部署某些东西时,它会报告错误

gcloud app deploy <some>.yaml --configurations <config-name>
ERROR: (gcloud.app.deploy) Your current active account [<service-account-email>] does not have any valid credentials

我手头有凭据文件,但不知道如何应用它。任何帮助,将不胜感激。

【问题讨论】:

    标签: google-cloud-platform gcloud service-accounts


    【解决方案1】:

    您忘记激活您的服务帐户凭据:

    gcloud auth activate-service-account username@development-123456.iam.gserviceaccount.com --key-file=service_account.json
    

    【讨论】:

      猜你喜欢
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 2019-04-10
      • 2017-12-04
      • 1970-01-01
      • 2017-12-02
      • 2021-10-24
      • 1970-01-01
      相关资源
      最近更新 更多