Can I restrict a service account to run BiqQuery queries with dryRun only

284 Views Asked by At

I have a service account that is used only for dry runs to get. I don't need the SA to access actual data in BQ, I wonder if there is way to restrict the SA to execute only dry run queries and not to have access to the data itself.

1

There are 1 best solutions below

0
Pooja S On

The access restriction you are trying to implement is not possible through a service account.

To run a query job, the user must be granted bigquery.jobs.create permissions. In order for the query job to complete successfully, the user must also be granted access to the tables or views referenced by the query. The same permissions are required to execute a dry run as stated in this doc. So, it is impossible to restrict access using a service account for a dry run query.