Google cloud platform 从Google构建部署Google云功能
在尝试部署简单函数时,我遇到了403错误。这是我的全部yaml: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
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)这个
*@cloudbuild*