Stephane
Stephane

Reputation: 99

Access Denied: BigQuery BigQuery: Permission denied while writing data

I am trying to export data from bigquery to Google Cloud Storage while using command.

EXPORT DATA OPTIONS(
  uri='gs://bucket/archivage-base/Bases archivees/*.csv',
  format='CSV',
  overwrite=true,
  header=true,
  field_delimiter=';') AS
SELECT * FROM `base-012021.creation_tables.dataext`

And I have this error: Access Denied: BigQuery BigQuery: Permission denied while writing data.

I cannot understand why because the service account seems to have all the grants. And i didn't find any topic that heps me to solve the problem

Thank you !

Upvotes: 1

Views: 2472

Answers (2)

Sư Võ
Sư Võ

Reputation: 11

i had same issue.
First, you need to check service acct in IAM. enter image description here

after add, you create a file json Certification. and add it in project

Upvotes: 1

shollyman
shollyman

Reputation: 4384

If this is the live query you're using and you haven't redacted the real bucket name, it's probably because of the bucket string in the URI. The URI should be something like gs://your-bucket-name/prefix/path/to/output/yourfileprefix_*.csv

If you have redacted the bucket name, then check to make sure that the user (or service account) identity issuing the query has the requisite access to the bucket and objects in cloud storage.

Upvotes: 3

Related Questions