How do I create SQL connection to my app and Upload it to google cloud - sql

Thanks for getting back at me. Sorry for the late reply, it was bed-time this time. I need to connect the Cloud SQL database that I have created to my application that is in App Engine. I tried to follow the online tutorials but when I do apply such info I would get then gcloud app deploy it return a connection error. Please help. Also clarify here: When I execute the gcloud app deploy command I suppose it takes my local file to Google Cloud where I would see the entire folder and files of my project on the project I was deploying but I am seeing the old version of my project while presentation has changed to the latest version. Also last one how can I link domain nam from http://domain.google.com to my app in http://cloud.google.com . Please help I am dying with stress I have been trying in here

Given that you haven't provided any information as to what settings you are using, or what error has been provided it is impossible to know what kind of problem you are running into.
I suggest taking a look at the "Connecting to App Engine" page here. It should answer a lot of your questions around connecting from an App Engine app.

I see two questions here.
1.
I need to connect the Cloud SQL database that I have created to my
application that is in App Engine. I tried to follow the online
tutorials but when I do apply such info I would get then gcloud app
deploy it return a connection error. Please help. Also clarify here:
When I execute the gcloud app deploy command I suppose it takes my
local file to Google Cloud where I would see the entire folder and
files of my project on the project I was deploying but I am seeing the
old version of my project while presentation has changed to the latest
version.
I see your problem here to be with CloudSQL and GAE connectivity. Depending on whether you use GAE Standard or Flex and CloudSQL MySQL or POSTGRES the steps varies. Documentation is quite clear in here though.
2.
Also last one how can I link domain nam from http://domain.google.com
to my app in http://cloud.google.com . Please help I am dying with
stress I have been trying in here
This is going to be super simple, goto GCP cloud console, Navigate to GAE-->Settings-->Custom Domain and click on add custom domain "Enter the domain name you want to link" When you click continue you will be shown the steps for verifying the domain owneship and to point the DNS to the GAE.
Documented properly by GCP folks at https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains

If you are using GAE Standard or Flex, a possible result of command gcloud app deploy :
An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine App, check next links:
https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
https://cloud.google.com/appengine/docs/flexible/python/writing-application-logs
Mysql and Postgres connection:
https://cloud.google.com/sql/docs/mysql/connect-app-engine
https://cloud.google.com/sql/docs/postgres/connect-app-engine
Sometimes it easy share the app.yaml for replicate the app correctly.

Related

When does prisma need a shadowDatabase

when i tried npx prisma migrate, it complained about shadowDatabase not found, what i did was simply initialize a db on my local computer to use it a shadowDb for the database hosted on the internet, my question is, is the shadowDb used only for migrations? or is it used for other things? because when deploying the website on the internet, there wont be a local db on the server thats deployed in.
Thank you.

Parse server account key

Installed Parse Server on Digital Ocean, and have been trying to use the CLI to manage cloud code. I've hit a wall, since the CLI tool will not move forward without an account key on Parse.com (which no longer offers account keys). For example, if I type in "parse new", I get this:
We've changed the way the CLI works. To save time logging in, you should create an account key. Type "parse configure accountkey" to create a new account key. Read more at: https://parse.com/docs/cloudcode/guide#command-line-account-keys
If you actually do that, it responds:
Input your account key or press ENTER to generate a new one. NOTE: on pressing ENTER we'll try to open the url: "https://www.parse.com/account/keys" in the default browser:
This leads to a login page. Since I don't have an account on Parse.com (nor should it be necessary for Parse Server), I'm stuck. If I click on the "I don't have an account" link, it just takes me to the front page.
I find it hard to believe that there's no way to manage/create cloud code on Parse Server. But, it is sure looking that way. Is this just a failure to update the CLI or am I missing something obvious.
Many thanks.
Parse cli is not meant to be used with parse server. At least not currently. Parse server is simply a node module which means that you will have to handle deployment etc yourself. There are many tools that will handle everything that the parse cli did, and much more, from the nodejs community however.
You said that you used digital ocean. You might want to consider heroku, aws or google cloud. Heroku for example has the heroku cli with many of the same features as the parse cli which might save you some time.
You can't use parse cli on parse-server. Parse-server and parse.com environment are both different , parse-server is just the node module so deployment can be automated using other tools.
I am using forever to restart my parse-server automatically when a file changes. So you can just copy/paste your files using filezilla and that's it.

Bluemix VMs on eu-gb: OS_TENANT_ID missing from CLI file

VMs is up on eu-gb region which is great.
However Horizon does not appear to be installed on there, which is fine, as I use the CLI most of the time. However the CLI file that I download from the Bluemix console is not correct.
It is missing the OS_TENANT_ID property. I cannot connect to my OpenStack tenant without this. Where can I get tenant ID from?
according to Bluemix VM documentation
https://www.ng.bluemix.net/docs/virtualmachines/vm_index.html#vm_setup_cli
you should login into your region&org and download the rc file one you are going to create the first VM.
The rc file download following these steps will contain all the information you need to access and manage your VM on Bluemix using openstack client.
In the case of you already downloaded your rc file following these steps I suggest you to try again generating a new one to check the new one contains all the information you need (consider that this environment is still beta and this kind of issues could be expected)

AppEngine Backup from one app to another

I can't seem to restore my AppEngine backups to a new app as listed in the documentation.
We are using the cron backup as listed in the documentation.
I get through all the stages to launch the restore job successfully, but when it kicks of all the shards are failing with 503 errors.
I tried this with multiple backup files and the experience is the same.
any advice?
(Java runtime)
I'm posting this hoping this will help someone, as there is really lack of resources around Google's documentation and the web in general about this.
While the appengine documentation says this can be done, I actually found the piece of code that forbids this inside the data_storeadmin app.
I managed to connect through python remote-api shell, read an entity from the backup and tried saving to the datastore, but datastore.Put(entity) operation yielded: "BadRequestError: app s~app_a cannot access app s~app_b's data" so it seems to be on an even lower level.
In the end, I decided to restore only a specific namespace to the same app which was also a tedious task - but it did save the day.
I Managed to pull my backup locally through gsutil, install a python-remote-api version on my app, accessed the interactive shell and wrote this script:
https://gist.github.com/Shuky/ed8728f8eb6187475b9a
Hope this helps.
Shuky

LocalResource not available after publishing mvc4 to azure

I've a very simple application built in MVC4. This application allow the users to upload a file, and the application generates an output.
This app works great locally, but when I publish to azure (by right click -> publish), I get a less descriptive error. I've figured out that the error was because in the code, we accessed to a server relative path, and that is not possible in azure. So I've found a way to solve that in this link, that says that I should use LocalResource, rather than Server.MapPath. That make sense for me, but so far, I'm struggling with the suggested line.
LocalResource localResource = RoleEnvironment.GetLocalResource("DownloadedTemplates");
I'm not able to get it working, and also can't get a proper error. BTW I'm not sure how to enable the error log in azure :(
So, after going deeper in MSDN, I've seen that I should configure the Local Storage Resources, but as I've created a local MVC4 project, I can't find where I should configure this.
I need to be able to store a temporary file in the application (hosted in azure).
Did someone faced with this problem?
Anybody knows how to enable the Local Storage Resource in a project like that?
TIA!
Milton Rodríguez
Well, after struggling a while, I've ended up using Windows Azure Tools.
The steps:
Add a new project
Under Cloud category, select Windows Azure Cloud Service.Note that if you don't have this option, an option to install the needed SDK will be shown. Install it first.
Name it properly :)
New Windows Azure Cloud Service window will appear, select the role that fits your needs. In my case, I choose ASP.Net MVC4, and then removed it.Note that you can edit the name of the created role at the right.
In the Roles folder of your new project, select Add, and then Web Role Project in solution. Your project will be an option to add.
You can remove the other role in the folder, the web project created in step 4, and also the folder ending in Content (ie. WebRole1Content). Basically, you can remove the created assets, but the Azure Service, and link the service to your project.
You're almost done. Follow this link to configurate your local storage :)
Now you're done!