Microsoft.DBforPostgreSQL servers

Bicep resource definition

The servers resource type can be deployed with operations that target:

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

Resource format

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

resource symbolicname 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = {
  identity: {
    type: 'string'
  }
  location: 'string'
  name: 'string'
  properties: {
    infrastructureEncryption: 'string'
    minimalTlsVersion: 'string'
    publicNetworkAccess: 'string'
    sslEnforcement: 'string'
    storageProfile: {
      backupRetentionDays: int
      geoRedundantBackup: 'string'
      storageAutogrow: 'string'
      storageMB: int
    }
    version: 'string'
    createMode: 'string'
    // For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
  }
  sku: {
    capacity: int
    family: 'string'
    name: 'string'
    size: 'string'
    tier: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

ServerPropertiesForCreateOrServerProperties objects

Set the createMode property to specify the type of object.

For Default, use:

{
  administratorLogin: 'string'
  administratorLoginPassword: 'string'
  createMode: 'Default'
}

For GeoRestore, use:

{
  createMode: 'GeoRestore'
  sourceServerId: 'string'
}

For PointInTimeRestore, use:

{
  createMode: 'PointInTimeRestore'
  restorePointInTime: 'string'
  sourceServerId: 'string'
}

For Replica, use:

{
  createMode: 'Replica'
  sourceServerId: 'string'
}

Property values

Microsoft.DBforPostgreSQL/servers

Name Description Value
identity The Azure Active Directory identity of the server. ResourceIdentity
location The location the resource resides in. string (required)
name The resource name string (required)
properties Properties of the server. ServerPropertiesForCreateOrServerProperties (required)
sku The SKU (pricing tier) of the server. Sku
tags Resource tags Dictionary of tag names and values. See Tags in templates

ResourceIdentity

Name Description Value
type The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. 'SystemAssigned'

ServerForCreateTags

Name Description Value

ServerPropertiesForCreateOrServerProperties

Name Description Value
createMode Set to 'Default' for type ServerPropertiesForDefaultCreate. Set to 'GeoRestore' for type ServerPropertiesForGeoRestore. Set to 'PointInTimeRestore' for type ServerPropertiesForRestore. Set to 'Replica' for type ServerPropertiesForReplica. 'Default'
'GeoRestore'
'PointInTimeRestore'
'Replica' (required)
infrastructureEncryption Status showing whether the server enabled infrastructure encryption. 'Disabled'
'Enabled'
minimalTlsVersion Enforce a minimal Tls version for the server. 'TLS1_0'
'TLS1_1'
'TLS1_2'
'TLSEnforcementDisabled'
publicNetworkAccess Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' 'Disabled'
'Enabled'
sslEnforcement Enable ssl enforcement or not when connect to server. 'Disabled'
'Enabled'
storageProfile Storage profile of a server. StorageProfile
version Server version. '10'
'10.0'
'10.2'
'11'
'9.5'
'9.6'

ServerPropertiesForDefaultCreate

Name Description Value
administratorLogin The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). string (required)
administratorLoginPassword The password of the administrator login. string

Constraints:
Sensitive value. Pass in as a secure parameter. (required)
createMode The mode to create a new server. 'Default' (required)

ServerPropertiesForGeoRestore

Name Description Value
createMode The mode to create a new server. 'GeoRestore' (required)
sourceServerId The source server id to restore from. string (required)

ServerPropertiesForReplica

Name Description Value
createMode The mode to create a new server. 'Replica' (required)
sourceServerId The master server id to create replica from. string (required)

ServerPropertiesForRestore

Name Description Value
createMode The mode to create a new server. 'PointInTimeRestore' (required)
restorePointInTime Restore point creation time (ISO8601 format), specifying the time to restore from. string (required)
sourceServerId The source server id to restore from. string (required)

Sku

Name Description Value
capacity The scale up/out capacity, representing server's compute units. int

Constraints:
Min value = 0
family The family of hardware. string
name The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. string (required)
size The size code, to be interpreted by resource as appropriate. string
tier The tier of the particular SKU, e.g. Basic. 'Basic'
'GeneralPurpose'
'MemoryOptimized'

StorageProfile

Name Description Value
backupRetentionDays Backup retention days for the server. int
geoRedundantBackup Enable Geo-redundant or not for server backup. 'Disabled'
'Enabled'
storageAutogrow Enable Storage Auto Grow. 'Disabled'
'Enabled'
storageMB Max storage allowed for a server. int

Quickstart samples

The following quickstart samples deploy this resource type.

Bicep File Description
Deploy Azure Database for PostgreSQL with VNet This template provides a way to deploy an Azure database for PostgreSQL with VNet integration.
Sonarqube Docker Web App on Linux with PostgreSQL This template provides a easy way to deploy a Sonarqube docker image (alpine tag) on a Linux Web App with Azure database for PostgreSQL(Preview)

ARM template resource definition

The servers resource type can be deployed with operations that target:

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

Resource format

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

{
  "type": "Microsoft.DBforPostgreSQL/servers",
  "apiVersion": "2017-12-01",
  "name": "string",
  "identity": {
    "type": "string"
  },
  "location": "string",
  "properties": {
    "infrastructureEncryption": "string",
    "minimalTlsVersion": "string",
    "publicNetworkAccess": "string",
    "sslEnforcement": "string",
    "storageProfile": {
      "backupRetentionDays": "int",
      "geoRedundantBackup": "string",
      "storageAutogrow": "string",
      "storageMB": "int"
    },
    "version": "string",
    "createMode": "string"
    // For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
  },
  "sku": {
    "capacity": "int",
    "family": "string",
    "name": "string",
    "size": "string",
    "tier": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

ServerPropertiesForCreateOrServerProperties objects

Set the createMode property to specify the type of object.

For Default, use:

{
  "administratorLogin": "string",
  "administratorLoginPassword": "string",
  "createMode": "Default"
}

For GeoRestore, use:

{
  "createMode": "GeoRestore",
  "sourceServerId": "string"
}

For PointInTimeRestore, use:

{
  "createMode": "PointInTimeRestore",
  "restorePointInTime": "string",
  "sourceServerId": "string"
}

For Replica, use:

{
  "createMode": "Replica",
  "sourceServerId": "string"
}

Property values

Microsoft.DBforPostgreSQL/servers

Name Description Value
apiVersion The api version '2017-12-01'
identity The Azure Active Directory identity of the server. ResourceIdentity
location The location the resource resides in. string (required)
name The resource name string (required)
properties Properties of the server. ServerPropertiesForCreateOrServerProperties (required)
sku The SKU (pricing tier) of the server. Sku
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.DBforPostgreSQL/servers'

ResourceIdentity

Name Description Value
type The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. 'SystemAssigned'

ServerForCreateTags

Name Description Value

ServerPropertiesForCreateOrServerProperties

Name Description Value
createMode Set to 'Default' for type ServerPropertiesForDefaultCreate. Set to 'GeoRestore' for type ServerPropertiesForGeoRestore. Set to 'PointInTimeRestore' for type ServerPropertiesForRestore. Set to 'Replica' for type ServerPropertiesForReplica. 'Default'
'GeoRestore'
'PointInTimeRestore'
'Replica' (required)
infrastructureEncryption Status showing whether the server enabled infrastructure encryption. 'Disabled'
'Enabled'
minimalTlsVersion Enforce a minimal Tls version for the server. 'TLS1_0'
'TLS1_1'
'TLS1_2'
'TLSEnforcementDisabled'
publicNetworkAccess Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' 'Disabled'
'Enabled'
sslEnforcement Enable ssl enforcement or not when connect to server. 'Disabled'
'Enabled'
storageProfile Storage profile of a server. StorageProfile
version Server version. '10'
'10.0'
'10.2'
'11'
'9.5'
'9.6'

ServerPropertiesForDefaultCreate

Name Description Value
administratorLogin The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). string (required)
administratorLoginPassword The password of the administrator login. string

Constraints:
Sensitive value. Pass in as a secure parameter. (required)
createMode The mode to create a new server. 'Default' (required)

ServerPropertiesForGeoRestore

Name Description Value
createMode The mode to create a new server. 'GeoRestore' (required)
sourceServerId The source server id to restore from. string (required)

ServerPropertiesForReplica

Name Description Value
createMode The mode to create a new server. 'Replica' (required)
sourceServerId The master server id to create replica from. string (required)

ServerPropertiesForRestore

Name Description Value
createMode The mode to create a new server. 'PointInTimeRestore' (required)
restorePointInTime Restore point creation time (ISO8601 format), specifying the time to restore from. string (required)
sourceServerId The source server id to restore from. string (required)

Sku

Name Description Value
capacity The scale up/out capacity, representing server's compute units. int

Constraints:
Min value = 0
family The family of hardware. string
name The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. string (required)
size The size code, to be interpreted by resource as appropriate. string
tier The tier of the particular SKU, e.g. Basic. 'Basic'
'GeneralPurpose'
'MemoryOptimized'

StorageProfile

Name Description Value
backupRetentionDays Backup retention days for the server. int
geoRedundantBackup Enable Geo-redundant or not for server backup. 'Disabled'
'Enabled'
storageAutogrow Enable Storage Auto Grow. 'Disabled'
'Enabled'
storageMB Max storage allowed for a server. int

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Airflow Docker Web App on Linux with PostgreSQL

Deploy to Azure
This template provides a easy way to deploy a puckel/docker-airflow image (latest tag) on a Linux Web App with Azure database for PostgreSQL
Airflow Web App with PostgreSQL database on App Services

Deploy to Azure
A template for deploying Airflow Web App with PostgreSQL database on App Services
Buffalo Web App

Deploy to Azure
Start running your Golang Buffalo Application on Azure quickly and cheaply.
Deploy Azure Database for PostgreSQL with VNet

Deploy to Azure
This template provides a way to deploy an Azure database for PostgreSQL with VNet integration.
Sonarqube Docker Web App on Linux with PostgreSQL

Deploy to Azure
This template provides a easy way to deploy a Sonarqube docker image (alpine tag) on a Linux Web App with Azure database for PostgreSQL(Preview)
Web App on Linux with PostgreSQL

Deploy to Azure
This template provides a easy way to deploy Web App on Linux with Azure database for PostgreSQL(Preview).
Web App on Linux with PostgreSQL

Deploy to Azure
This template provides a easy way to deploy Web App on Linux with Azure database for PostgreSQL.

Terraform (AzAPI provider) resource definition

The servers resource type can be deployed with operations that target:

  • Resource groups

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

Resource format

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DBforPostgreSQL/servers@2017-12-01"
  name = "string"
  identity = {
    type = "string"
  }
  location = "string"
  sku = {
    capacity = int
    family = "string"
    name = "string"
    size = "string"
    tier = "string"
  }
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      infrastructureEncryption = "string"
      minimalTlsVersion = "string"
      publicNetworkAccess = "string"
      sslEnforcement = "string"
      storageProfile = {
        backupRetentionDays = int
        geoRedundantBackup = "string"
        storageAutogrow = "string"
        storageMB = int
      }
      version = "string"
      createMode = "string"
      // For remaining properties, see ServerPropertiesForCreateOrServerProperties objects
    }
  })
}

ServerPropertiesForCreateOrServerProperties objects

Set the createMode property to specify the type of object.

For Default, use:

{
  administratorLogin = "string"
  administratorLoginPassword = "string"
  createMode = "Default"
}

For GeoRestore, use:

{
  createMode = "GeoRestore"
  sourceServerId = "string"
}

For PointInTimeRestore, use:

{
  createMode = "PointInTimeRestore"
  restorePointInTime = "string"
  sourceServerId = "string"
}

For Replica, use:

{
  createMode = "Replica"
  sourceServerId = "string"
}

Property values

Microsoft.DBforPostgreSQL/servers

Name Description Value
identity The Azure Active Directory identity of the server. ResourceIdentity
location The location the resource resides in. string (required)
name The resource name string (required)
properties Properties of the server. ServerPropertiesForCreateOrServerProperties (required)
sku The SKU (pricing tier) of the server. Sku
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.DBforPostgreSQL/servers@2017-12-01"

ResourceIdentity

Name Description Value
type The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. 'SystemAssigned'

ServerForCreateTags

Name Description Value

ServerPropertiesForCreateOrServerProperties

Name Description Value
createMode Set to 'Default' for type ServerPropertiesForDefaultCreate. Set to 'GeoRestore' for type ServerPropertiesForGeoRestore. Set to 'PointInTimeRestore' for type ServerPropertiesForRestore. Set to 'Replica' for type ServerPropertiesForReplica. 'Default'
'GeoRestore'
'PointInTimeRestore'
'Replica' (required)
infrastructureEncryption Status showing whether the server enabled infrastructure encryption. 'Disabled'
'Enabled'
minimalTlsVersion Enforce a minimal Tls version for the server. 'TLS1_0'
'TLS1_1'
'TLS1_2'
'TLSEnforcementDisabled'
publicNetworkAccess Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' 'Disabled'
'Enabled'
sslEnforcement Enable ssl enforcement or not when connect to server. 'Disabled'
'Enabled'
storageProfile Storage profile of a server. StorageProfile
version Server version. '10'
'10.0'
'10.2'
'11'
'9.5'
'9.6'

ServerPropertiesForDefaultCreate

Name Description Value
administratorLogin The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). string (required)
administratorLoginPassword The password of the administrator login. string

Constraints:
Sensitive value. Pass in as a secure parameter. (required)
createMode The mode to create a new server. 'Default' (required)

ServerPropertiesForGeoRestore

Name Description Value
createMode The mode to create a new server. 'GeoRestore' (required)
sourceServerId The source server id to restore from. string (required)

ServerPropertiesForReplica

Name Description Value
createMode The mode to create a new server. 'Replica' (required)
sourceServerId The master server id to create replica from. string (required)

ServerPropertiesForRestore

Name Description Value
createMode The mode to create a new server. 'PointInTimeRestore' (required)
restorePointInTime Restore point creation time (ISO8601 format), specifying the time to restore from. string (required)
sourceServerId The source server id to restore from. string (required)

Sku

Name Description Value
capacity The scale up/out capacity, representing server's compute units. int

Constraints:
Min value = 0
family The family of hardware. string
name The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. string (required)
size The size code, to be interpreted by resource as appropriate. string
tier The tier of the particular SKU, e.g. Basic. 'Basic'
'GeneralPurpose'
'MemoryOptimized'

StorageProfile

Name Description Value
backupRetentionDays Backup retention days for the server. int
geoRedundantBackup Enable Geo-redundant or not for server backup. 'Disabled'
'Enabled'
storageAutogrow Enable Storage Auto Grow. 'Disabled'
'Enabled'
storageMB Max storage allowed for a server. int