Database Reference
In-Depth Information
Service Account and Local Testing
Service account credentials are easy to obtain when your application is
actually running in App Engine. However, during development, the
local development server cannot generate the credential for the service
account associated with your application. This is inconvenient because
all the code that interacts with BigQuery will fail. Fortunately, the
dev_appserver.py supports passing it a different service account
and private key on the command line and then simulates the
production behavior but generates credentials for the supplied service
account instead. Chapter 3, “Getting Started with BigQuery,” covers the
provisioning of service accounts in a project.
The private key downloaded from the Google Developer Console is not
in the right format for use with the development server, so it needs to
be converted before it can be used. The following instructions require
that you have OpenSSL installed.
$ SERVICE_ACCOUNT='<account email>'
$ DOWNLOADED_KEY='downloaded-privatekey.p12'
$ DEVAPPSERVER_KEY='/tmp/key-rsa.pem'
$ openssl pkcs12 -in ${DOWNLOADED_KEY} \
- nodes -nocerts -passin pass:notasecret |
openssl rsa -out ${DEVAPPSERVER_KEY}
$ dev_appserver.py \
-- appidentity_email_address ${SERVICE_ACCOUNT} \
-- appidentity_private_key_path
${DEVAPPSERVER_KEY} \
sensors/cloud/src/app.yaml
This runs the development server locally on port 8080 and an
administration console on port 8000. The application depends on
certain datasets and tables existing in your BigQuery project. To create
them, visit the administration console at http://localhost:8000/
and navigate to the Cron Jobs section. Run each of the jobs listed
starting with /dashboard/create . Once this is done you can visit
Search WWH ::




Custom Search