Database Reference
In-Depth Information
To authenticate as a service account, you need to create a separate
configuration file. First, you need the client e-mail address, which you can
find in the JSON file that you downloaded with the account information.
It
looks
like
<service-account-id> @developer. gserviceaccount.com .
Create a configuration file for the service account called $HOME/
.bigqueryrc.< service-account - id > with the following contents.
service_account =
<service-account-id>@developer.gserviceaccount.com
service_account_credential_file = <location for token
file>
service_account_private_key_file = <location of
downloaded private key>
project_id = <project-id>
The download for this chapter contains a script to help you generate this file
from the client secrets you downloaded from the APIs console. You have to
copy or move the private key you downloaded to the location specified by the
second argument to the script ( $HOME/.bigquery.privatekey.p12 ),
which ends up as the value for the
service_account_private_key_file flag. It is a good idea to make
this file readable by your account only, especially if it is a shared machine.
$ export SERVICE_ACCOUNT_ID="<account-id>"
$ python make_service_account_rc.py \
<path to client_secrets.json> \
<path to private key file> \
>$HOME/.bigqueryrc.$SERVICE_ACCOUNT_ID
Search WWH ::




Custom Search