Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 从Google构建部署Google云功能_Google Cloud Platform_Google Cloud Functions_Google Cloud Build - Fatal编程技术网

Google cloud platform 从Google构建部署Google云功能

Google cloud platform 从Google构建部署Google云功能,google-cloud-platform,google-cloud-functions,google-cloud-build,Google Cloud Platform,Google Cloud Functions,Google Cloud Build,在尝试部署简单函数时,我遇到了403错误。这是我的全部yaml: steps: # Install Dependencies - name: 'python' id: Pip install args: ['pip3', 'install', '-r', 'requirements.txt', '--user'] # Run Tests - name: 'python' args: ['python3', '-m', 'pytest', 'functions/folder_a/tes

在尝试部署简单函数时,我遇到了403错误。这是我的全部yaml:

steps:
# Install Dependencies
- name: 'python'
  id: Pip install
  args: ['pip3', 'install', '-r', 'requirements.txt', '--user']
# Run Tests
- name: 'python'
  args: ['python3', '-m', 'pytest', 'functions/folder_a/test/']
# Deploy Cloud Functions
- name: 'gcr.io/cloud-builders/gcloud'
  id: 'helloFunction'
  args: ['functions', 'deploy', 'hello', '--source' , 'functions/folder_a/main.py',
           '--runtime' , 'python37' ,'--trigger-http']

第一步很好,但第二步出错

$ gcloud info

Account: [projectname@appspot.gserviceaccount.com]
Project: [projectname]

Current Properties:
  [core]
    project: [projectname]
    account: [projectname@appspot.gserviceaccount.com]
    disable_usage_reporting: [True]
我尝试将以下权限添加到IAM中的上述帐户:

  • 云构建服务代理
  • 云功能开发者
  • 云功能服务代理
  • 编辑

当Google Build运行时,它使用的是哪个服务帐户?如何更改权限以允许自动部署功能?

中介绍了使用云构建部署云功能

从该页开始,指南如下:

  • 要部署云功能,您可能需要将云功能开发人员角色分配给云构建服务帐户(PROJECT)_NUMBER@cloudbuild.gserviceaccount.com)
  • 如果使用云功能开发人员角色,还需要授予云功能运行时服务帐户(PROJECT)_ID@appspot.gserviceaccount.com)这个
云构建服务帐户为PROJECT_NUMBER@cloudbuild.gserviceaccount.com,如果您在控制台中查找,则只有一个服务帐户具有
*@cloudbuild*