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...

Create Azure Virtual Network Gateway with Basic SKU Using PowerShell

Why Do You Need a Virtual Network Gateway? A Virtual Network Gateway is essential for establishing secure connectivity between your on-premises network and Azure Virtual Network (VNet). It acts as the VPN endpoint in Azure, encrypting traffic using IPsec/IKE tunnels. Without it, you cannot create a secure VPN tunnel to Azure. Why Use the Basic SKU? Cost-Effective:  The Basic SKU is the most affordable option, making it ideal for test, dev, or non-production environments. Quick Deployment:  Unlike higher SKUs that can take 30–45 minutes, the Basic SKU typically deploys in only  7–10 minutes . Sufficient for Small Workloads:  Supports basic VPN connectivity without advanced features like BGP or high throughput. Note:  The Basic SKU is no longer available in the Azure Portal UI, but you can still deploy it using PowerShell or Azure CLI. PowerShell Script to Deploy Basic SKU VPN Gateway Here’s how to create a Virtual Network Gateway with Basic SKU in an existing VNe...

Contact Form

Name

Email *

Message *