Reputation: 6055
Google Cloud Function is throwing following error despite the fact that service account which is used in Cloud Scheduler and the account which is trying to invoke the cloud function both have the listed permission granted.
This is the cloud scheduler configuration:
and permissions allocated to this account.
This is the cloud functions log output:
Upvotes: 0
Views: 1340
Reputation: 81464
The service account (the identity that is calling BigQuery) does not have the permission bigquery.jobs.create.
Add the IAM role roles/bigquery.jobUser aka BigQuery Job User to the service account.
It is not clear from your question, but it appears that you are calling Cloud Functions. Cloud Functions then calls BigQuery. The service account assigned to Cloud Functions requires the IAM permission.
Upvotes: 0
Reputation: 2227
Cloud Function uses a service account to run its code. This service account (SA) can be different from the one used and you are showing in Cloud Scheduler. (By default Cloud Function uses App Engine default SA as you can see in the screenshot below)
So start by checking which SA are you using and which roles it has.
By the way if you access the log entry in Google Cloud Logging and expand all nested fields, you can find which identity is missing which permissions through the authenticationInfo
and authorizationInfo
fields
Upvotes: 3