Point-Click Deploy PostgreSQL on Windows Azure
PostgreSQL is the most stable Open Source database out there. Arguably, it is more enterprise quality than other Open Source databases out there. In this article, I will show you how to deploy PostgreSQL on Windows Azure using Dynamic Deploy. I will also show you how to create a tablespace on an external drive and create a database on that tablespace.
|
Windows Azure Platform |
Table of Contents
Disclaimer
Please read the Disclaimer and Terms & Conditions before making any deployment decisions
Pre-requisites
Create a Windows Azure Subscription if you don’t have one already
Deployment Procedure
1) Navigate to Dynamic Deploy PostgreSQL Page
Sign-In/Sign-Up
2) Click on Deploy
3) Select a supported Datacenter
Each application has a database affinity in Dynamic Deploy. This is to avoid any outbound data transfer costs.
4) Upload your .publishsettings file (You can click this link to download your .publishsettings file)
We encrypt all the subscription information using certificates.
5) Select a subscription
If you have multiple subscriptions, a dropdown list will pop-up giving you a choice of subscription for deployment.
6) Storage and Compute
Select an existing Storage Account and a Hosted Service or create new ones if required
Here we conduct some tests for accessing your storage account. It may take a couple of minutes.
7) Select VM Size
Be careful when selecting VM sizes as this will affect your cost and performance too.
NOTE: Extra Small VMs are very slow for software like this. So, your experience will be deteriorated.
Note down username and create a password for the administrator account
8 ) Accept the Terms & Conditions to start the deployment
Once the deployment is complete, you will see the Deployment Status green, the deployment time specified, and the list of virtual machine instances. In the figure below we have only one instance deployed.
Post-Deployment
1) RDP into the Virtual Machine from the Windows Azure Portal
2) Navigate to
C:\Program Files\PostgreSQL\9.2\bin
3) Open pgAdmin3.exe
4) Right-Click Connect to PostgreSQL
Password: postgres
Once connected, you can play around with the database
5) Attach an external Disk
Then, I attached, formatted and mounted an external empty hard-disk to the VM. Procedure is well documented here.
Next, I created a new tablespace (ftb_space) on F:\pgsql\data (F: is the newly mounted drive)
( I had to give Everyone write permissions to the external folder)
Creating a Sample Database
Finally, I followed the procedure for creating a new sample database (dvdrental) from here.
http://www.postgresqltutorial.com/load-postgresql-sample-database/
When you create a new database, make sure you select the new tablespace to store the data on the external disk.
You can also connect to the database remotely over port 5432. You will need to create a new TCP endpoint on the VM from Windows Azure portal
Happy Deploying!




