Verify/change application region at Google App Engine
Solution 1
You can use gcloud app describe --project <projectId>
command to get the location.
You cannot change an app's region after you set it.
Refer here.
For example:
$ gcloud app describe --project myapp-1337
authDomain: gmail.com
codeBucket: staging.myapp-1337.appspot.com
defaultBucket: myapp-1337.appspot.com
defaultHostname: myapp-1337.appspot.com
featureSettings:
splitHealthChecks: true
gcrDomain: us.gcr.io
id: myapp-1337
locationId: us-central
name: apps/myapp-1337
servingStatus: SERVING
Solution 2
You can see the location of your application at [1].
Regarding changing the region, please see [2] for more information.
[1] - https://appengine.google.com/
[2] - Change GAE application location
Update: EU app creation is now possible from the new Developers console and doesn't require whitelist / premier status. Looks like Location tab will only show in the GAE console if account was whitelisted / Premier. A way to find app location is still in the old GAE console -> from the list click on the app to go to the dashboard -> if you see e~ in the link after app_id=, your app is in EU, else if you see s~ your app is in the US.
Another alternative is to use gcloud command suggested by Ilya Zakreuski below.
Solution 3
You can get the AppId from the runtime environment:
Java:
ApiProxy.getCurrentEnvironment().getAppId()
or Python:
os.environ['APPLICATION_ID']
where the prefixes as mentioned by @Ilya and @Nikita still apply:
prefixed with e~ means EU and s~ means US.
P.S. It looks like both the dev consoles have been updated to get the App ID from elsewhere, so they don't have this prefix.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on July 09, 2022Comments
-
Admin almost 2 years
I'm creating a GAE application.
When I set my GAE PHP application as an authorized application to access my Cloud SQL instance, I get the following warning:
App Engine regions must be the same as Cloud SQL instance regions!
How can I verify or change the region of my GAE application?
Thx
-
Admin almost 10 yearswhen i look at appengine.google.com. I have only 4 column table, 'application', 'title', 'storage scheme', and 'status'. Is the 'location' column available for everyone?
-
Admin almost 10 yearsAnd for changing my region, so if my cloud sql setup in asia region its impossible if i change my application to asia region too? what the best way can i do? change and create a new cloud sql instance and make same with my app region? Sorry i am just a newbie and thank you so much for your help.
-
Nikita Uchaev almost 10 yearsYour app is located in US. Asia region is not available for App Engine, only for GCE and CloudSQL. If you want to have an App in Europe, you'll have to fill in the form and wait till your email is whitelisted. Afterwards you'll be able to choose a region (EU or US) when creating a new App.
-
Nikita Uchaev almost 10 yearsSorry, my bad. Location column only appears if you have the ability to create EU Apps.
-
Admin almost 10 yearsOke i got the solve, i create a new cloud sql instance in US region so my app can connect to there.. thank you so much for your help nikita :)
-
Lee about 9 yearsThe answer's first link is now obsolete and the second link never answered the related question.
-
Nikita Uchaev about 9 years@Lee First link is not obsolete. Change of region for created app is not possible. Its necessary to create a new app, deploy and migrate Datastore (e.g. Datastore Admin), domain mappings, etc.
-
Lee about 9 years@NikitaUchaev Its obsolete in that it does not display the application's location. Is this feature supported?
-
Nikita Uchaev about 9 years@Lee Specially for you I took this from my GAE console. Is your account whitelisted for EU app creation?
-
Nikita Uchaev about 9 years@Lee Doesn't look like this option works correctly from the new console. I created a new EU project, but still see US for location in the old GAE console (and my account is premier). Do you have an option to select EU when creating an app from the old console?
-
Lee about 9 years@NikitaUchaev No, I'm not. That's really confusing and should be considered a "Major" bug.
-
Nikita Uchaev about 9 years@Lee EU app creation is now working correctly. Still, location tab will only show in the GAE console only if account was whitelisted / Premier. A way to find app location is still in the old GAE console -> from the list click on the app to go to the dashboard -> if you see
e~
in the link afterapp_id=
, your app is in EU, else if you sees~
your app is in the US. -
Lee about 9 years@NikitaUchaev I highly recommend editing your last comment into your answer. A sincere thank you for your attention and patience!
-
yaraju about 9 years@NikitaUchaev It looks like this option is also no longer valid - The old Appengine console no longer shows any "e~" or "s~" in the AppID
-
Nikita Uchaev about 9 years@ yaraju Still there in the old console for me. Proof.