Skip to main content

Deploy Azure Database for PostgreSQL using ARM template

Azure Database for PostgreSQL is a relational database service based on the open-source Postgres database engine. It's a fully managed service provided by Microsoft Azure. It offers mission-critical workloads with predictable performance, security, high availability and dynamic scalability. 

    It's available in two deployment options

  1. Single Server (supports vertical scale on demand)
  2. Hyperscale server (supports horizontal scale across machine using sharding) 

For this blog, we'll explore "Single Server" deployment only.

We'll also be looking into few integrations along with the deployment of Azure Database for PostgreSQL. These integration will include:

  1. Virtual Network integration for existing virtual network
  2. Diagnostics logs integration (generated logs to send across storage account and log analytics workspace and stream to event hub)
  3. Azure Active Directory User/group integration
  4. Key vault integration to store administrator password

Pre-requisites before running ARM template:

I would recommend to have below resources created already in your environment if it is not present right now before proceeding with deployment

  1. Azure Subscription
  2. Azure Resource Group (rg-postgresqlpoc)
  3. Virtual Network to integrate
  4. Storage account, Log Analytics Workspace and Event hub to integrate 
  5. Azure AD user/group integrate
  6. Key vault with secret to integrate

Our approach for various integrations is to use linked ARM template. Linked template refers to a separate template file that is referenced via a link from the main template.

So, there will be two .json template file and one .json parameter file.

Template file:

This is the child template calling the parent template under the variable "templateuri". When referencing a linked template, the value of uri must not be a local file or a file that is only available on your local network. You must provide a URI value that downloadable as http or https. 

Parameter file:



Once you have template and parameter file ready, you can either deploy it using Azure portal, PowerShell script. We'll use "Deploy a custom template" feature over Azure portal.

Step 1: Open Azure portal, search "Deploy a custom template"

Step 2: Load template and parameter file using "Edit template" and "Edit parameters" option respectively as shown in below screenshot




Step 3: Click "Next : Review + Create", it will run validation. Once validation succeed, you can see the message as per below screenshot:

Step 4: Click "Create" to create Azure Database for PostgreSQL with all integrations.

and, that's pretty much it!

Please note, I've done mainly all the integration in parent file uploaded at storage account and just using child template for key vault integration. 

Parent file includes AD integration, Diagnostic Logs integration and VNet integration whereas key vault integration is in child template file as shown in below screenshot.

AD Integration section in parent template file:

Diagnostics Logs Integration section in parent template file:

VNet Integration section in parent template file:

Key Vault Integration section in child template file:

Summary:

This complete deployment with all possible integrations took around 10-12 mins. only. This covered all aspects of deployment and design in this article. 

If you have any suggestions/feedback, please leave your comment below. Thanks!

Comments

Popular posts from this blog

Workload Protection with Microsoft Defender for Cloud

‘ Microsoft Defender for Cloud’ (previously known as Azure Security Center and Azure Defender) is a tool that strengthen your Cloud Security Posture Management (CSPM) and Cloud Workload Protection (CWP) . It protects your workload running in Azure, hybrid, or any other cloud platforms. In this blogpost, we will mainly focus on Cloud Workload Protection (CWP), which are typically agent-based workload-centric security protection solutions along with below topics. 1.                           Enable ‘ Microsoft Defender for Cloud ’ on your subscriptions 2.                           Enable Enhanced security features 3.                           Workload Protection a.       Dashboard coverage b. ...

The Beginner's Guide to Understand AI in 2025

Artificial Intelligence (AI) is reshaping the world at an unprecedented pace. In 2025, AI is not just a buzzword—it's a core technology that impacts everything from business and health to how we work, shop, and communicate. If you’re new to AI, this guide is for you. Here’s a simple, structured introduction to what AI is, how it works, and how you can make sense of its impact on our daily lives. What Is Artificial Intelligence? AI refers to machines or computer systems that mimic human intelligence. This includes learning from data, understanding language, recognizing images, making decisions, and even generating creative content. Think of AI as the “brains” powering smart assistants like Siri, recommending videos on YouTube, or detecting fraud in your online banking. Types of AI Narrow AI: Performs specific tasks (e.g., voice assistants, image recognition). This is what most AI in 2025 is. General AI: Theoretical machines with human-like cognition across any task. We’re not ther...

AWS Has Replaced Its Free Tier — Here's How the New Credit-Based System Works (2025 Guide)

If you've been learning AWS with the old Free Tier, you might've missed the quiet but critical shift: Amazon Web Services officially replaced its 12-month Free Tier with a new credit-based model as of early 2025. This isn't just a tweak — it's a strategic overhaul. The goal? Reduce abuse, improve monetization, and better align free access with real-world learning needs. But don't panic. The new system still offers generous access — if you know how to use it . In this guide, we'll break down: How the new AWS Free and Paid plans differ Who qualifies for signup credits Which plan to choose based on your goals Pro tips to avoid unexpected charges Whether you're studying for the AWS Certified Cloud Practitioner , building a personal project, or evaluating AWS for your team — this is essential reading. 🔍 The Two New Paths: Free Plan vs Paid Plan AWS now offers two distinct tiers for new users. Understanding the difference is crucial to avoiding ...

Contact Form

Name

Email *

Message *