Your first steps in setting up Cloud Build for deploying Google Cloud Functions but running into yet another error? You’re not alone. With this blog post, I hope to put you on your way again.
Have you run into the following error?
“Permission ‘cloudfunctions.functions.get’ denied on resource […]”
Here’s what’s going on. Cloud Build needs a service account to access the resources you’re trying to deploy.
Option 1: Cloud Build Settings
By going to the Settings section of Cloud Build, you’ll be able to enable the Cloud Functions Developer role, which has the cloudfunctions.functions.get permission.
By enabling the status of this role, you will be able to deploy your function.
Option 2: IAM
You can also provide the service account with the proper role/permissions by visiting the IAM page and adding a new member to the project.
Thank you! It solved an issue with our github actions unable to deploy to our hosting.
Thing I don’t understand is why it suddenly stopped to work.
Too easy. Thanks!