How to Deploy Azure PostgreSQL Database? 9 Easy Steps

on Cloud Computing, Data Integration, Microsoft Azure • February 10th, 2022 • Write for Hevo

Azure PostgreSQL- Featured Image

Azure PostgreSQL Database is a popular option for many businesses. They get to have all the benefits of community PostgreSQL, but with the added convenience of Azure cloud and at any scale. When PostgreSQL database servers run in the cloud, companies don’t have to worry about maintaining them. Microsoft Azure gives them the benefit of using a highly available, massively scalable, and fully-managed PostgreSQL service right at their fingertips.

If you are confused about using Azure Database for PostgreSQL, worry not. This tutorial is there to help. We will walk you through 9 easy steps, which you can do to take advantage of PostgreSQL on the Azure Cloud. So, let’s get started.

Table of Contents

What is Microsoft Azure?

Microsoft Azure Cloud: Azure PostgreSQL Database
Image Source: Logos World

Microsoft Azure is a Cloud Computing Platform that offers businesses computing, analytics, storage, and networking services on the cloud. With Microsoft Azure, your company engages in a much more reliable and quality-driven process of storing and transforming your data, based on your requirements.

Since the launch of AWS Cloud Computing Services, Microsoft Azure has positioned itself as the second biggest cloud alternative. It comes in three modes- Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS), and offers a surplus of tools that can propel your business to new heights of success. Microsoft Azure is trusted and used by Fortune 500 Companies, so you can be sure of their power-packed services. 

Key Features of Microsoft Azure

  • Speedy Application Development: Microsoft Azure Cloud helps developers gain two major advantages. First, it reduces time to market by extending your web apps to support your mobile clients. It also supports app publishing with easily consumable REST APIs. Second, Azure’s IaaS or PaaS provides fully managed services needed to host your apps.
  • Reliable Data Accessibility & Support– Microsoft Azure offers 99.95% availability SLA and 24×7 tech support to your business. It features built-in high availability, point-in-time backup, and single-digit millisecond latency to support each of your requirements.
  • Pay for What You Want: Microsoft Azure lets your company pay only for what you need. As an example, your company can reduce development costs using low-code solutions. Microsoft Azure provides you with actionable cost optimization and resource management recommendations to tailor-fit your business costs and needs.
  • Integrate and Sync: Microsoft Azure lets you integrate and sync virtual devices and directories. It also integrates with Logic Apps, Service Bus, API Management, and Event Grid to provide your business with a complete one-destination solution.

What is PostgreSQL?

PostgreSQL: Azure PostgreSQL Database
Image Source: Software Engineering Daily

PostgreSQL is a Relational Database Management System (RDBMS) developed by the PostgreSQL Global Development Group. It has been in use for over 20 years and supports both SQL and JSON for relational and non-relational queries in order to provide flexibility and SQL compliance.

PostgreSQL has had a reputation for being a dependable, feature-rich, and performance-rich utility from its beginnings. Many businesses rely on PostgreSQL as their primary data storage/data warehouse for online, mobile, geospatial, and analytics applications. PostgreSQL runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. 

Key Features of PostgreSQL

  • Open-Source: PostgreSQL is an Object-Relational Database Management System (ORDBMS). This allows PostgreSQL to provide Object-Oriented and Relational Database functionality. PostgreSQL is a free and Open-Source ORDBMS.
  • Prominent User Base: PostgreSQL users include prominent names like Apple, Cisco, Etsy, Facebook, Instagram, Red Hat, Skype, Spotify, Yahoo, to name a few.
  • Multiversion Concurrency Control: To manage concurrent requests, PostgreSQL features a multi-version concurrency control which gives each transaction a “snapshot” of the database, allowing changes to be made without affecting other transactions. This largely eliminates the need for read locks, and ensures the database maintains ACID principles. 
  • Reliability and Standards Compliance: PostgreSQL’s write-ahead logging makes it a fault-tolerant database. Its large base of open source contributors lends it a built-in community support network. PostgreSQL is ACID compliant, and has full support for foreign keys, joins, views, triggers, and stored procedures, in many different languages. 
  • A Supportive Community: PostgreSQL offers a dedicated community that is always available to you. Private, third-party support services are also available. The community updates the PostgreSQL platform via the PostgreSQL Global Development Group.

Simplify Your ETL & Data Analysis Using Hevo’s No-Code Data Pipeline 

Hevo Data, a No-code Data Pipeline, helps load data from any Data Source such as Databases, SaaS applications, Cloud Storage, SDKs, and Streaming Services and simplifies the ETL process. It supports 100+ Data Sources like Azure Database for PostgreSQL and includes 40+ Free Sources. It is a 3-step process by just selecting the data source, providing valid credentials, and choosing the destination. Hevo loads the data onto the desired Data Warehouse/Destination like Google BigQuery, Snowflake, Amazon Redshift, and Firebolt and enriches the data transforming it into an analysis-ready form without having to write a single line of code.

Get Started with Hevo for Free

Check out why Hevo is the best:

  • Minimal Learning: Hevo, with its simple and interactive UI, is extremely simple for new customers to work on and perform operations.
  • Hevo Is Built To Scale: As the number of sources and the volume of your data grows, Hevo scales horizontally, handling millions of records per minute with very little latency.
  • Secure: Hevo has a fault-tolerant architecture that ensures that the data is handled securely and consistently with zero data loss.
  • Schema Management: Hevo takes away the tedious task of schema management & automatically detects the schema of incoming data and maps it to the destination schema.
  • Incremental Data Load: Hevo allows the transfer of data that has been modified in real-time. This ensures efficient utilization of bandwidth on both ends.
  • Live Support: Our team is available round the clock to extend exceptional support to its customers through Chat, Email, and Support Calls.
  • Live Monitoring: Hevo allows you to monitor the data flow and check where your data is at a particular point in time.
Sign up here for a 14-Day Free Trial!

What is Azure Database for PostgreSQL?

Microsoft Azure Database for PostgreSQL: Azure PostgreSQL Database
Image Source: Microsoft Docs

PostgreSQL is one of the many database servers that you can run on the Microsoft Azure Cloud. Besides PostgreSQL, Microsoft Azure Cloud also supports SQL Server, MySQL, CosmosDB, Cassandra, and many other database platforms. This Platform-as-a-Service (PaaS) model featuring PostgreSQL as a relational database service on Azure Cloud is called Azure Database for PostgreSQL.

Azure PostgreSQL Database is a fully-managed database service, which means that your company gets to focus on essential tasks, instead of worrying about managing virtual machines and infrastructure. It offers automated maintenance for the underlying hardware and comes with an operating system and database engine to keep your service secure and up to date. 

Benefits of Using Azure PostgreSQL Database

Other leading features that Azure PostgreSQL Database offers to businesses include:

  • Built-in high availability.
  • Automatic backups for data protection.
  • Automated maintenance.
  • Elastic scaling within seconds.
  • Enterprise-grade security and industry-leading compliance.
  • Monitoring and automation to simplify large-scale deployments.
  • Outstanding customer support.

Deployment Models for Azure PostgreSQL Database

Azure PostgreSQL Database service comes in three deployment modes:

Single Server

Azure PostgreSQL Single Server is designed for users who work with essential database management functions such as patching, backups, high availability, and security with minimal user configuration and control. It offers 99.99% availability and supports community versions of PostgreSQL 9.5, 9,6, 10, and 11.  You can find more information on Azure PostgreSQL Single Server pricing tiers, by clicking here

Flexible Server

Azure PostgreSQL Flexible Server goes a step further to provide more granular control and flexibility over database management functions. You can customize the service to suit your needs and change configuration settings. Flexible Server provides better cost optimization controls with the ability to stop/start the server. It’s ideal for workloads that don’t need full-compute capacity continuously. It currently supports PostgreSQL 11 and 12 community versions. This option is currently in public preview. Find more information on Azure PostgreSQL Flexible Server by clicking here.

Hyperscale (Citus)

Azure PostgreSQL Hyperscale is designed for heavy workloads. This deployment model can scale queries horizontally across multiple machines using sharding. It also offers query parallelization across servers for faster response times. If your business makes use of real-time data analytics, Azure PostgreSQL Hyperscale can be an excellent option for you.

When it comes to choosing the right Azure PostgreSQL Server option, many businesses prefer Azure PostgreSQL Single Server for handling their typical daily transactional requirements. If your business needs fine-tuning around server settings and a greater level of customization, you can opt for other deployment modes. For your reference consider this Azure PostgreSQL Server selection guide on Microsoft’s page. 

How to Set Up Azure Database for PostgreSQL Using Azure Portal

If you are completely new to setting up Azure PostgreSQL Database, this step-by-step guide will help you. It’s a nine-step easy process to use your regular PostgreSQL features on the Azure cloud. For this tutorial, we’ll guide you on the steps to create a single Azure Database for the PostgreSQL server (Azure Postgre SQL Single Server), so follow along and get yours started:

Note: Make sure you have Microsoft Azure Subscription before you proceed ahead. If you are a new customer, you can sign up on their website here

Create an Azure Postgre SQL Database Server

Step 1: Visit your Azure Portal after logging in. Type postgresql in the search bar and select the option corresponding to Azure Database for PostgreSQL servers.

Azure Search PostgreSQL: Azure PostgreSQL Database
Image Source: Microsoft Docs

Step 2: Under the section, “How do you plan to use the service?”, find the Single Server tab. Select the “Create” button beneath it.

Azure Single Server for PostgreSQL: Azure PostgreSQL Database
Image Source: Microsoft Docs

Step 3: Fill in the information on the form page as per your specifications. 

Azure Single Server Settings for PostgreSQL: Azure PostgreSQL Database
Image Source: Microsoft Docs

You can input your fields as per the information given below:

  • Subscription: Select your Azure subscription.
  • Resource group: Enter a new/existing resource group from your subscription. 
  • Server name: Input a unique name for your Azure Postgre SQL server.
  • Data source: Choose None when creating a new server or Backup when using an existing one.
  • Admin username: Type in your server admin name. 
  • Password: Input a new password for your server admin.
  • Version: Select your desired PostgreSQL version. 

Once done, click on “Review + Create” button. After verifying your information, click “Create” to initiate your Azure SQL Database PostgreSQL.

Azure Single Server Deployment Done: Azure PostgreSQL Database
Image Source: Microsoft Docs

Make your Azure Database for PostgreSQL Public 

By default, the Azure PostgreSQL server is not available for public access. To change your server accessibility from private to public, follow these steps:

Step 1: Visit Connection Security under your Settings.

Step 2: Under Firewall rules, choose Add current client IP address

Azure Single Server Firewall Settings: Azure PostgreSQL Database
Image Source: Microsoft Docs

Step 3: Hit Save.

Microsoft Azure gives you options to add more IP addresses or an IP range to your Azure PostgreSQL Database Server. To add more, click on +Add 0.0.0.0 – 255.255.255.255, or input your IP address range in the Firewall rule name.  

Connect Azure Postgre SQL Server with psql

To connect Microsoft Azure Cloud and PostgreSQL, you would need PostgreSQL clients like psql or pgAdmin. In this tutorial, we have used psql to link Azure PostgreSQL. To do so, follow these steps:

Step 1: Copy your Server Name and Admin Username information to a safe space. You can find this under Overview section. 

Azure Single Server Admin Information: Azure PostgreSQL Database
Image Source: Microsoft Docs

Step 2: Open Azure Cloud Shell from the top pane. 

Azure Cloud Shell: Azure PostgreSQL Database
Image Source: Microsoft Docs

Step 3: Execute the following command in your terminal. Make sure to insert your server name and admin username in this command before hitting enter. 

psql --host=mydemoserver.postgres.database.azure.com --port=5432 --username=myadmin@mydemoserver --dbname=postgres

Here’s what your output will look like:

Requesting a Cloud Shell.Succeeded.
 Connecting terminal...

 Welcome to Azure Cloud Shell

 Type "az" to use Azure CLI
 Type "help" to learn about Cloud Shell

 user@Azure:~$psql --host=mydemoserver.postgres.database.azure.com --port=5432 --username=myadmin@mydemoserver --dbname=postgres
 Password for user myadmin@mydemoserver.postgres.database.azure.com:
 psql (12.2 (Ubuntu 12.2-2.pgdg16.04+1), server 11.6)
 SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
 Type "help" for help.

 postgres=>

Step 4: Next, create a database called guest.

postgres=> CREATE DATABASE guest;

Step 5: Change your directory to the guest.

c guest

Step 6: Type q, and then select the Enter key to close psql.

There you have it. Your Azure SQL Database PostgreSQL Service has been successfully set up.

Conclusion

Azure PostgreSQL Database is the same open-source PostgreSQL database software that can be used on the cloud. The added benefit? Microsoft Azure takes care of your database maintenance and security obligations. This service provides a relational database solution with horizontal scalability across as many machines – and locations – as needed. You wouldn’t have to compromise on application performance or data security concerns. Azure SQL Database PostgreSQL covers all.

If your business actively uses Azure PostgreSQL Database for web applications, there’s a high chance you would want to have a backup option for your PostgreSQL database. A Cloud-based Data Warehousing solution can be an effective remedy for your data storage and transformation needs. A simple and speedy solution like Hevo ETL helps you in that. 

Effective ETL tools like Hevo expressly handle the issue of heterogeneous data source connection, allowing Small and Medium Businesses to operate smoothly with their everyday applications including Azure Database for PostgreSQL.

Hevo Data with its strong integration with 100+ Sources & BI tools such as Azure Database for PostgreSQL, allows you to not only export data from sources & load data in the destinations, but also transform & enrich your data, & make it analysis-ready so that you can focus only on your key business needs and perform insightful analysis using BI tools. 

Visit our Website to Explore Hevo

Hevo lets you migrate your data from your PostgreSQL database to any Data Warehouse of your choice, like Amazon Redshift, Snowflake, Google BigQuery, or Firebolt, within minutes with just a few clicks.

Why not try Hevo? Sign Up here for a 14-day free trial and experience the feature-rich Hevo suite first hand. You can also check our pricing and make a decision on your best-suited plan. 

Share your ideas about learning Azure PostgreSQL Database in the comments area below. Tell us of any other Azure Database integrations you’d want us to cover. We’d like to hear your thoughts and ideas.

No-code Data Pipeline for Your Data Warehouse