GAE: Can I copy an entire app to another identifier? - google-app-engine

I recall seeing an option on the google app engine admin page that would allow me to duplicate/copy a deployment to a different appid. Was I imagining this? I do have a copy of all the files needed for deployment but I do not currently have access to a computer with admin privileges in order to install the GAE SDK.
Not relevant to this question, but FYI I need to do this simply because there is a major bug that's preventing me from logging in to a particular part of the admin interface and google tech support has failed to resolve the issue, so I'm just trying a workaround.

Copy old settings to new app via the admin console admin>application settings>Duplicate Application Settings. (you'll choose new appid here too)
Then upload a version of your code to the new appId (so you'll need gae sdk or use online sdk devtable).
Then go to datastore admin in the old app, select all the entities and choose "copy to another app" You'll need datastore admin to be enabled on the old app (and new app I think).

Related

How to bring Azure App Registrations from DEV to PROD without recreating them manually?

I have an App Registration, which is currently within my DEV environment. It contains a lot of settings (Mainly App Roles). I tried to download the Manifest.json and upload it again to the new registration, but the setting were not written at all.
Is there a better way than recreating the whole App Registration from scratch for the TEST and PROD environment?
Move comment to answer so that this post can be treated as answered.
Using script to generate registrations in all environments could be one option.
The important thing needs to remember is handling the GUID such as OAuth2Permissions id, appRoles id and so on.

Setting target url with gcloud

I have been using the Google App Engine Launcher's "Deploy" button. I realize that the Launcher is going away at the end of July 2020, so I'm trying to learn to use gcloud. My web site has a custom url, www.xxx.org, but "gcloud app deploy" uploads to xxx.appspot.com instead of to www.xxx.org, presumably because "target url" is set to xxx.appspot.com. Can someone please tell me what gcloud command I need to use to change "target url" to www.xxx.org, or some other scheme that would work? I've wandered through lots of gcloud and GAE documentation and web searches without being able to figure out what I need to do.
There is a very good and complete guide about mapping a custom domain to your application in the official documentation. As #DanCornilescu said,it needs to be configured, but it is not necessary to be done before deployment.
Basically, you need to follow the steps from the guide:
1) Verify that you are the owner of your domain through Webmaster
Central
2)Ensure that your domain has been verified, otherwise you will not be able to proceed with the following steps. Note that only verified domains will be displayed.
3)If you need to delegate the ownership of your domain to other users or service accounts, you can add permission through the Webmaster Central page
4)After you verify ownership of your domain, you can map that domain to your App Engine app
5)Add the resource records that you receive to the DNS configuration of your domain registrar
6)Test for success by browsing to your app via its new domain URL, for example www.example.com
In case you need to do more complex mappings for different urls and subdomains you can always write down the routing rules in the dispatch.yaml file and they will be mapped successfully.
Also, to add a bit more of information about the dipatch.yaml file, it will handle the routing in the App as opposed with the app.yaml which will take care of the App's settings. Both .yamls can exist in the same application and can be deployed at the same time by using the following gcloud command:
gcloud app deploy app.yaml dispatch.yaml
The deployment is always done to .appspot.com, the custom domain is automatically updated if it is already configured. If it is not then it needs to be configured (it can be done after the deployment as well).

Where is App Engine projects after upgrading to Cloud Platform?

I don't see any of my App Engine projects from either https://appengine.google.com/start or https://cloud.google.com/console/project.
I'm not sure if I've deleted them, while I can't create a new project with the same id.
Given that (a) you're sure you're logged in with the correct account, and (b) you don't see it in either the AppEngine or the Developers console UI, it most likely has been deleted.
Since AppEngine disallows reuse of application ids, it will prevent creating an app of the same name.
As an aside, if you remember the exact name of your AppEngine app, you can try to access it at this URL:
https://appengine.google.com/dashboard?&app_id=s~[app-name-here]
and if you get redirected back to the main AppEngine page, then it has been deleted.

An API for creating and managing Google Cloud Console projects?

I believe there is an undocumented Google API available to create and manage Google Cloud Console (and App Engine) projects on behalf of third party users.
Does anyone know how to use it?
I think older versions of the Google Eclipse Plugin obtained an OAuth2 token in the (undocumented) scope https://www.googleapis.com/auth/appengine.admin, and this allowed it to generate a Cloud Console project on your behalf. The latest version doesn't seem to do this. App Engine's own appcfg.py also uses this scope, but doesn't seem to do much more than deploy the code - I'm looking to change core settings for the project, such as Name, Redirect URLs, and Web Origins.
Any information would be appreciated.
I maintain a WordPress plugin providing secure Google Apps Login for end users, and currently have to give detailed instructions to admins for creating a new Cloud Console project manually, and entering settings such as Redirect URL. Ideally, I would create a simple on-line service to do all of this for them.
Thank you!
It is possible to programmatically create a new Developer Console project on behalf of a Google Account (yes, you read that right). You do so in a very roundabout way:
Request the https://www.googleapis.com/auth/drive.scripts scope from the user (standard OAuth 2.0 flow).
Use the Drive API's drive.insert method to create a new file with a mimetype of application/vnd.google-apps.script.
Somehow try to get the project ID, maybe by uploading some Apps Script code? This is the part that I was never able to figure out.
A little known fact is that every Google Apps Script project has a hidden Developer Console project associated with it. This project is not shown in the list of projects, but it does exist. It is created automatically when the user starts a new Apps Script project, and the drive.insert method is enough to cause this to happen.
How do you get to the hidden project? Well, the only way I know of is to open the Apps Script project from the Drive website, open the "Resources > Advanced Google Services" dialog, and click the link to the Developer Console. You'll find the project ID in the URL.
Aside from not being shown in your list of projects and not being able to use App Engine, this is a normal Developer Console project. You can add additional OAuth client credentials, service accounts, Compute Engine instances, etc. And of course once you have a project ID, all of the various management APIs will work: creating new virtual machines, making use of a service account's impersonation ability, etc.

Deleting a Google App Engine application

Is it possible to delete an GAE application after it has been created?
I made a mistake while typing the name and now have a dummy application that I haven't been able to remove.
With the new Google Cloud console, you can still disable GAE applications as before (App Engine --> Settings --> Disable). They cannot currently be deleted. However you can delete the entire project by going to IAM --> Settings --> Shut Down. This button is in the header and a bit tricky to spot. It looks like this:
As of AppEngine SDK 1.2.6 it's possible to delete apps completely. But beware, the app-id won't be usable again.
As most of the answers are outdated or contradictive and this is an important question I decided to clarify current possible solutions when intending to delete an application in Google App Engine or having related issues.
Currently, there is no way to delete an existing app in GAE. Once created it cannot be removed, nor its initial settings can be changed (like the region where it was deployed). The only possible workaround is starting a new project and deploying a new application. There were feature requests in Google Issue Tracker regarding these issues: deleting an app and changing zone/region. You can still delete the whole project as described in Steve Armstrong's answer, but bear in mind that this will remove everything you created there (like GCE, GKE etc.), not only GAE.
However, it all depends on why you would like to delete your app. If you would simply like to stop it from serving requests or you don't want it to incur further costs, you can disable the app as described in the GCP docs here.
This feature is already logged, please star it:
http://code.google.com/p/googleappengine/issues/detail?id=335
To disable /delete your application:
In the Administration Console, click your application to make it the active application.
Click Application Settings on the left side under Administration.
Click Disable Application.
Click Disable Application Now.
If you want to delete your app:
If billing is enabled for your app, disable billing. You aren't allowed to delete before you do this.
Click Request Permanent Deletion. The application will be deleted in approximately 72 hours.
To re-enable your disabled application, click Re-Enable Application.
source
There currently isn't a way to delete a GAE application.
Beyond disabling the App Engine application you can:
Disable it's API permission under APIs & Services
Remove the App Engine related files from Storage
Delete App Engine permissions under IAM & Admin
Delete the App Engine Service account
This will freeze all App Engine related billing charges for the undeletable disabled App engine application. At least it worked for me :)
I was evaluating if we could use AppEngine and ran the standard tutorial which created a test app for me under my the default project. When I tried to delete the App I was shocked that it can't be done ! The only way is to delete the project which would delete all other GKE and any other services under that account.
After a bunch of research and calling product support of Google this what they suggested: To upgrade to Silver Support for 150$/month and send them an email to delete the app.
Here is the chat session with Google Support. If you were considering using Google AppEngine I would think again.
This issue has been fixed; see the docs here:
https://cloud.google.com/appengine/docs/standard/python/console/?csw=1#delete_app
Carlos, you're right that the issue has been fixed, and I up-voted you for that. However, your link is a little outdated and an updated link is listed below.
https://developers.google.com/appengine/docs/adminconsole/applicationsettings#Disable_or_Delete_Your_Application
open https://console.cloud.google.com/cloud-resource-manager?organizationId=0 ,select the project(or application) to be deleted,then click delete
I wanted to delete some legacy Google App Engine applications I made years ago, but when I tried to delete them from the new Google Cloud Platform (like this: https://support.google.com/cloud/answer/6251787#shut-down-a-project) I kept getting "You do not have permission" errors. The solution I found was to sign up for a free trial of Google Cloud Platform, then I was able to delete them.
I couldn't find to delete the default app-engine, however if you navigate to App Engine > Settings , there is a button to Disable it and it stop serving. when you click on the button type the project name in the prompt.

Resources