Consider a python script running on App Engine, is it possible to access particular Google Sheet that has been shared with app engine default service account of that GCP project where the python scrip is deployed.
Is it possible to build the service endpoint for Google Sheets API
service = build('sheets', 'v4', credentials=creds) # without passing credentials parameter explicitly
without passing credentials file explicitly, is it possible for App Engine app(python script) to take default App Engine service account implicitly(like it dose for Cloud services)
Hello,
Set the environment variable “GOOGLE_APPLICATION_CREDENTIALS” and share the sheet with the app engine default service account. After setting the environment variable, you don't need to explicitly specify your credentials in code when using a Google Cloud client library. The client library can determine your credentials implicitly..
Example:
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="key.json”
service = discovery.build("sheets","v4")
I hope this answers your question.
[1]https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable