Microsoft.DBforPostgreSQL flexibleServers/databases 2026-10-01

Bicep resource definition

The flexibleServers/databases resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Usage Examples

Bicep Samples

A basic example of deploying PostgreSQL Flexible Server Database.

@secure()
@description('The administrator password for the PostgreSQL flexible server')
param postgresqlAdministratorPassword string
param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource flexibleServer 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
  name: resourceName
  location: location
  sku: {
    name: 'Standard_D2s_v3'
    tier: 'GeneralPurpose'
  }
  properties: {
    administratorLogin: 'adminTerraform'
    administratorLoginPassword: postgresqlAdministratorPassword
    availabilityZone: '2'
    backup: {
      geoRedundantBackup: 'Disabled'
    }
    highAvailability: {
      mode: 'Disabled'
    }
    network: {}
    storage: {
      storageSizeGB: 32
    }
    version: '12'
  }
}

resource database 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2022-12-01' = {
  name: resourceName
  parent: flexibleServer
  properties: {
    charset: 'UTF8'
    collation: 'en_US.UTF8'
  }
}

Azure Verified Modules

The following Azure Verified Modules can be used to deploy this resource type.

Module Description
DB for Postgre SQL Flexible Server - Database AVM Child Module for DB for Postgre SQL Flexible Server - Database

Resource format

To create a Microsoft.DBforPostgreSQL/flexibleServers/databases resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2026-10-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    charset: 'string'
    collation: 'string'
  }
}

Property Values

Microsoft.DBforPostgreSQL/flexibleServers/databases

Name Description Value
name The resource name string

Constraints:
Min length = 1
Max length = 63
Pattern = ^[a-zA-Z_][\w\-]{0,62}$ (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: flexibleServers
properties Properties of a database. DatabaseProperties

DatabaseProperties

Name Description Value
charset Character set of the database. string

Constraints:
Pattern = ^[a-zA-Z]+\w*$
collation Collation of the database. string

Constraints:
Pattern = ^[a-zA-Z\-]+([. ]|\w)*$

ARM template resource definition

The flexibleServers/databases resource type can be deployed with operations that target:

Usage Examples

Resource format

To create a Microsoft.DBforPostgreSQL/flexibleServers/databases resource, add the following JSON to your template.

{
  "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases",
  "apiVersion": "2026-10-01",
  "name": "string",
  "properties": {
    "charset": "string",
    "collation": "string"
  }
}

Property Values

Microsoft.DBforPostgreSQL/flexibleServers/databases

Name Description Value
apiVersion The api version '2026-10-01'
name The resource name string

Constraints:
Min length = 1
Max length = 63
Pattern = ^[a-zA-Z_][\w\-]{0,62}$ (required)
properties Properties of a database. DatabaseProperties
type The resource type 'Microsoft.DBforPostgreSQL/flexibleServers/databases'

DatabaseProperties

Name Description Value
charset Character set of the database. string

Constraints:
Pattern = ^[a-zA-Z]+\w*$
collation Collation of the database. string

Constraints:
Pattern = ^[a-zA-Z\-]+([. ]|\w)*$

Terraform (AzAPI provider) resource definition

The flexibleServers/databases resource type can be deployed with operations that target:

  • Resource groups For a list of changed properties in each API version, see change log.

Usage Examples

Terraform Samples

A basic example of deploying PostgreSQL Flexible Server Database.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "postgresql_administrator_password" {
  type        = string
  description = "The administrator password for the PostgreSQL flexible server"
  sensitive   = true
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "flexibleServer" {
  type      = "Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLogin         = "adminTerraform"
      administratorLoginPassword = var.postgresql_administrator_password
      availabilityZone           = "2"
      backup = {
        geoRedundantBackup = "Disabled"
      }
      highAvailability = {
        mode = "Disabled"
      }
      network = {
      }
      storage = {
        storageSizeGB = 32
      }
      version = "12"
    }
    sku = {
      name = "Standard_D2s_v3"
      tier = "GeneralPurpose"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "database" {
  type      = "Microsoft.DBforPostgreSQL/flexibleServers/databases@2022-12-01"
  parent_id = azapi_resource.flexibleServer.id
  name      = var.resource_name
  body = {
    properties = {
      charset   = "UTF8"
      collation = "en_US.UTF8"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Resource format

To create a Microsoft.DBforPostgreSQL/flexibleServers/databases resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DBforPostgreSQL/flexibleServers/databases@2026-10-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      charset = "string"
      collation = "string"
    }
  }
}

Property Values

Microsoft.DBforPostgreSQL/flexibleServers/databases

Name Description Value
name The resource name string

Constraints:
Min length = 1
Max length = 63
Pattern = ^[a-zA-Z_][\w\-]{0,62}$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: flexibleServers
properties Properties of a database. DatabaseProperties
type The resource type "Microsoft.DBforPostgreSQL/flexibleServers/databases@2026-10-01"

DatabaseProperties

Name Description Value
charset Character set of the database. string

Constraints:
Pattern = ^[a-zA-Z]+\w*$
collation Collation of the database. string

Constraints:
Pattern = ^[a-zA-Z\-]+([. ]|\w)*$