Python 3: how to determine the current app's project id?

463 views
Skip to first unread message

Ryan B

unread,
Nov 6, 2019, 10:11:14 AM11/6/19
to Google App Engine
Hi all! In the Python 2 runtime, I can use the app_identity API to determine the current app's project id (ie application id) with app_identity.get_application_id(). Anyone know how to do this in the Python 3 runtime? https://cloud.google.com/appengine/docs/standard/python3/python-differences#app_engine_apis doesn't mention the app_identity API, and https://cloud.google.com/appengine/docs/standard/python3/python-differences#modules doesn't mention project id.

Thanks in advance!

Ryan B

unread,
Nov 6, 2019, 5:10:24 PM11/6/19
to Google App Engine

might be worth adding to the differences page!

Elliott (Cloud Platform Support)

unread,
Nov 6, 2019, 6:17:25 PM11/6/19
to Google App Engine
Hello Ryan,

I've sent your feedback on the differences page.

Jason Collins

unread,
Nov 6, 2019, 8:24:01 PM11/6/19
to Google App Engine
Ryan, in runtime:python37 there is also a metadata server like the GCE metadata server. Unfortunately, you'll have to find the docs for that over in the Java8 docs... https://cloud.google.com/appengine/docs/standard/java/accessing-instance-metadata
Reply all
Reply to author
Forward
0 new messages