Database URL of a postgresql database residing in an Azure VM - django

I have an Azure VM that runs Ubuntu and has a Django app of mine along with its postgresql database installed on it.
Moreover, I also have an Azure Web App that was created with Django, which I then connected to github, and pulled the source code for the same app I have on the aforementioned Azure VM.
I now want the settings.py in this Django Azure Web App to point to the database residing in the Azure VM.
Normally, the way to do this is to list the database url in the app's settings.py. My question is: what would be the database url for my postgresql database installed in the Azure VM, if one was to try and access it from an Azure Web App (i.e. external to the Azure VM)? Would it be: postgres://AzureVM'sFQDN:5432/nameofdatabase?

Provided you have opened port 5432 on the VM, that would be the right string to connect to your database from anywhere. Have you tried to connect your development machine to this database?
If you have created your set-up with the new resource manager deployment model of azure, you should also be able to create both the web-app and the database VM within the same virtual network. This way, you can provide access to the database only for the Web App, and not for the entire internet.

Related

How to host an API (written in Flask-SQLAlchemy) to communicate with a Docker-ized MySQL container?

Context
I have a backend and API written in Python and Flask-SQLAlchemy. I use Flask-SQLAlchemy to define tables for a MySQL database, and my API routes access these tables. Previously, all my development has been on my local machine and my Flask-SQLAlchemy communicated with a local SQLite database. I currently have a Docker container with a MySQL image which contains an empty MySQL database.
What I Am Trying To Accomplish
I would like to host this API online, as well as host the Docker container (which contains a MySQL database) online. The Flask-SQLAlchemy API should communicate with the hosted MySQL database.
Options I've Considered
To my understanding, there are several options to host my API and MySQL database online.
For my API, I can either host my API onto AWS Elastic Beanstalk, or onto Docker then onto EC2.
For my MySQL database, I would like to host it onto Docker then onto EC2.
The following is how I assume I can approach this:
Problem
Should I host my Flask-SQLAlchemy API on Elastic Beanstalk, or on Docker then onto EC2? My main goal is to have my hosted API talk to a MySQL database hosted on Docker.

Access a postgresql instance set up on GCE from local host via proxy

Can I access a PostgreSQL instance set up on Google Cloud Engine from my local host via Cloud SQL Proxy or another way?
I'm trying to move a PostgreSQL database from Cloud SQL to Compute Engine for testing purposes. So far, I 've been using Cloud SQL Proxy to run Django migrations on Cloud SQL from my local host, and I'd like to do the same with the database set up on GCE.
Yes you can access a postgresl instance set on Google Cloud Engine form local host.
You need to follow these steps:
Install PostgreSQL on a Compute Engine instance.
Configure PostgreSQL for remote access.
Configure a Cloud Platform firewall to open a port.
Connect to PostgreSQL from a remote computer.
How to set up PostgreSQL on Compute Engine

Django with MySQL deploy on aws ec2

I want to deploy my django with MySQL db for production on aws ec2. Files and db are present on the server.
follow the official docs http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html, start directly at "Configure Your Django Application for Elastic Beanstalk", since you have already developed your app

How to establish WebAPI for Amazon RDS SQL Database?

I am working on Xamarin Mobile App for which we are using SQL 2012 as Server Database. DB is already hosted in Amazon RDS. However, I am not clear on creating WebApi for the database.
How to establish WebAPI for Amazon RDS SQL Database?
I DO suggestion to create an API as this can serve as the interface between your database and your Xamarin Mobile App.
You could use AWS Elastic Beanstalk for the hosting. This guide shows you wow to work with .Net and RDS and later be able to deploy it on Amazon.

Database connections with RDS not working after deploying

I have developed a Dynamic web App, which leverages Amazon RDS. Servlet talks with RDS fetches data and presents it using JSP. The process is working fine. Next, I uploaded the war file of project on AWS Elastic beanstalk. But Database connections are not working.
Could you please guide me here? Why my connection variables are not working after deploying?
I made few changes to the early deployment and now App takes forever to load.