When attempting to deploy a simple function, I am running into a 403 error. Here is my full 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']
Step one finishes fine but step two errors here.
$ gcloud info
Account: [[email protected]]
Project: [projectname]
Current Properties:
[core]
project: [projectname]
account: [[email protected]]
disable_usage_reporting: [True]
I tried adding the following permissions to the above account in IAM:
- Cloud Build Service Agent
- Cloud Functions Developer
- Cloud Functions Service Agent
- Editor
When Google Build is running, which service account is it using? How can I change the permissions to allow automatic deploying of functions?