Standalone BigQuery Table Search System
- Create a Service Account:
Create a Service Account using these instructions.
The account will need the following roles against the GCP project or BQ datasets holding the data you wish to make searchable:
- BigQuery Job User
- Viewer
NOTE: For these next steps you will want to gcloud auth login and gcloud config set project <PROJECT ID> via the Google Cloud SDK to the GCP project used for development.
-
Give your personal account the IAM role
roles/iam.serviceAccountTokenCreatorrole on the Service Account you made:gcloud iam service-accounts add-iam-policy-binding <SERVICE ACCOUNT EMAIL> --member=user:<YOUR ACCOUNT EMAIL> --role=roles/iam.serviceAccountTokenCreator. -
On the GCloud SDK CLI, run the command
gcloud auth application-default login --impersonate-service-account <SERVICE ACCOUNT EMAIL>to create the default credentials account under your identity. -
Save a copy of
sample.envinto your secure files directory, renaming it todev.env. Add the missing values from the development tier's.env, and set theSECURE_PATHvalue to the absolute path on your file system to your secure files directory (eg.C:\Users\<USERNAME>\secure\dev\). -
In Pycharm, create a Flask configuration by clicking on
Edit Configurations...and choosing + from the upper left corner of dialog that opens. Choose your local Python interpreter, set the script to main.py, and set thePaths to ".env" filesto the full path to yourdev.env. -
Click the 'Play' button in Pycharm, or use
<PYTHON CMD> -m flask runfrom the project directory.