Pilkington
Pilkington

Reputation: 97

How to connect an Azure PostgreSQL Database created in a VM to my website?

I have a website deployed on Azure. I used PostgreSQL to create my database (with Sequelize as my ORM).

I know that Azure doesn't natively support PostgreSQL (I believe?) so I created a PostgreSQL database on a VM running on Ubuntu, while running on Azure.

However, I have to connect my website's server to the VM database, and I'm not quite sure how to do that, while also establishing the models I created in Sequelize.

Upvotes: 1

Views: 1414

Answers (1)

Tomas Kirda
Tomas Kirda

Reputation: 8413

You need to forward a port (usually 5432) on that VM firewall.

Then you simply connect to that machine by specifying your VM public IP address, or URL.

It makes sense to have your website and this VM inside same Virtual Network for performance reasons. You can actually do that with Azure Apps (former Websites).

Upvotes: 2

Related Questions