Verify/change application region at Google App Engine

24,170

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.

Share:
24,170
Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    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
    Admin almost 10 years
    when 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
    Admin almost 10 years
    And 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
    Nikita Uchaev almost 10 years
    Your 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
    Nikita Uchaev almost 10 years
    Sorry, my bad. Location column only appears if you have the ability to create EU Apps.
  • Admin
    Admin almost 10 years
    Oke 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
    Lee about 9 years
    The answer's first link is now obsolete and the second link never answered the related question.
  • Nikita Uchaev
    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
    Lee about 9 years
    @NikitaUchaev Its obsolete in that it does not display the application's location. Is this feature supported?
  • Nikita Uchaev
    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
    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
    Lee about 9 years
    @NikitaUchaev No, I'm not. That's really confusing and should be considered a "Major" bug.
  • Nikita Uchaev
    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 after app_id=, your app is in EU, else if you see s~ your app is in the US.
  • Lee
    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
    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
    Nikita Uchaev about 9 years
    @ yaraju Still there in the old console for me. Proof.