你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.DBforPostgreSQL flexibleServers 2022-12-01

Bicep 资源定义

可以使用目标操作部署 flexibleServers 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    name: 'string'
    tier: 'string'
  }
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {
        clientId: 'string'
        principalId: 'string'
      }
    }
  }
  properties: {
    administratorLogin: 'string'
    administratorLoginPassword: 'string'
    authConfig: {
      activeDirectoryAuth: 'string'
      passwordAuth: 'string'
      tenantId: 'string'
    }
    availabilityZone: 'string'
    backup: {
      backupRetentionDays: int
      geoRedundantBackup: 'string'
    }
    createMode: 'string'
    dataEncryption: {
      primaryKeyURI: 'string'
      primaryUserAssignedIdentityId: 'string'
      type: 'string'
    }
    highAvailability: {
      mode: 'string'
      standbyAvailabilityZone: 'string'
    }
    maintenanceWindow: {
      customWindow: 'string'
      dayOfWeek: int
      startHour: int
      startMinute: int
    }
    network: {
      delegatedSubnetResourceId: 'string'
      privateDnsZoneArmResourceId: 'string'
    }
    pointInTimeUTC: 'string'
    replicationRole: 'string'
    sourceServerResourceId: 'string'
    storage: {
      storageSizeGB: int
    }
    version: 'string'
  }
}

属性值

flexibleServers

名字 描述 价值
名字 资源名称 string (必需)
位置 资源所在的地理位置 string (必需)
标签 资源标记。 标记名称和值的字典。 请参阅模板 中的 标记
sku 服务器的 SKU(定价层)。 Sku
身份 描述应用程序的标识。 UserAssignedIdentity
性能 服务器的属性。 ServerProperties

UserAssignedIdentity

名字 描述 价值
类型 与此资源关联的标识类型;当前限制为“None 和 UserAssigned” “None”
“UserAssigned”(必需)
userAssignedIdentities 表示用户分配的标识映射。 UserAssignedIdentityMap

UserAssignedIdentityMap

名字 描述 价值
{自定义属性} UserIdentity

UserIdentity

名字 描述 价值
clientId 此标识表示的服务主体的客户端标识符。 字符串
principalId 此标识表示的服务主体的对象标识符。 字符串

ServerProperties

名字 描述 价值
administratorLogin 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 字符串
administratorLoginPassword 管理员登录密码(创建服务器时需要)。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 服务器的 AuthConfig 属性。 AuthConfig
availabilityZone 服务器的可用性区域信息。 字符串
备份 服务器的备份属性。 备份
createMode 创建新的 PostgreSQL 服务器的模式。 “Create”
“Default”
“GeoRestore”
“PointInTimeRestore”
“Replica”
“Update”
dataEncryption 服务器的数据加密属性。 DataEncryption
highAvailability 服务器的高可用性属性。 HighAvailability
maintenanceWindow 服务器的维护时段属性。 MaintenanceWindow
网络 服务器的网络属性。 仅当希望服务器成为专用访问服务器时,才需要传递此网络属性。 网络
pointInTimeUTC 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 字符串
replicationRole 服务器的复制角色 “AsyncReplica”
“GeoAsyncReplica”
“None”
“Primary”
sourceServerResourceId 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 此属性仅针对副本服务器返回 字符串
存储 服务器的存储属性。 存储
版本 PostgreSQL 服务器版本。 '11'
'12'
'13'
'14'

AuthConfig

名字 描述 价值
activeDirectoryAuth 如果已启用,则会启用 Azure Active Directory 身份验证。 “Disabled”
“Enabled”
passwordAuth 如果已启用,则启用密码身份验证。 “Disabled”
“Enabled”
tenantId 服务器的租户 ID。 字符串

备份

名字 描述 价值
backupRetentionDays 服务器的备份保留日。 int
geoRedundantBackup 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 “Disabled”
“Enabled”

DataEncryption

名字 描述 价值
primaryKeyURI 主服务器数据加密密钥的 URI。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 用于描述其是否为系统托管与 Azure Key Vault 的数据加密类型。 “AzureKeyVault”
“SystemManaged”

HighAvailability

名字 描述 价值
模式 服务器的 HA 模式。 “Disabled”
“SameZone”
“ZoneRedundant”
standbyAvailabilityZone 备用服务器的可用性区域信息。 字符串

MaintenanceWindow

名字 描述 价值
customWindow 指示是启用还是禁用自定义窗口 字符串
dayOfWeek 维护时段的星期几 int
startHour 维护时段的开始时间 int
startMinute 维护时段的开始时间 int

网络

名字 描述 价值
delegatedSubnetResourceId 委派的子网 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串
privateDnsZoneArmResourceId 专用 dns 区域 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串

存储

名字 描述 价值
storageSizeGB 服务器允许的最大存储。 int

Sku

名字 描述 价值
名字 SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 string (必需)
特定 SKU 的层,例如可突发。 “可突发”
“GeneralPurpose”
“MemoryOptimized”(必需)

快速入门模板

以下快速入门模板部署此资源类型。

模板 描述
使用 AAD 部署 Azure Database for PostgreSQL(灵活)

部署到 Azure
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 AAD 集成的方法。
使用 VNet 部署 Azure Database for PostgreSQL (灵活)

部署到 Azure
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 VNet 集成的方法。
使用 PostgreSQL 和 VNet 集成的 Web 应用 SonarQube

部署到 Azure
此模板提供使用 PostgreSQL 灵活服务器、VNet 集成和专用 DNS 轻松将 SonarQube 部署到 Linux 上的 Web 应用。

ARM 模板资源定义

可以使用目标操作部署 flexibleServers 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.DBforPostgreSQL/flexibleServers",
  "apiVersion": "2022-12-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "sku": {
    "name": "string",
    "tier": "string"
  },
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
        "clientId": "string",
        "principalId": "string"
      }
    }
  },
  "properties": {
    "administratorLogin": "string",
    "administratorLoginPassword": "string",
    "authConfig": {
      "activeDirectoryAuth": "string",
      "passwordAuth": "string",
      "tenantId": "string"
    },
    "availabilityZone": "string",
    "backup": {
      "backupRetentionDays": "int",
      "geoRedundantBackup": "string"
    },
    "createMode": "string",
    "dataEncryption": {
      "primaryKeyURI": "string",
      "primaryUserAssignedIdentityId": "string",
      "type": "string"
    },
    "highAvailability": {
      "mode": "string",
      "standbyAvailabilityZone": "string"
    },
    "maintenanceWindow": {
      "customWindow": "string",
      "dayOfWeek": "int",
      "startHour": "int",
      "startMinute": "int"
    },
    "network": {
      "delegatedSubnetResourceId": "string",
      "privateDnsZoneArmResourceId": "string"
    },
    "pointInTimeUTC": "string",
    "replicationRole": "string",
    "sourceServerResourceId": "string",
    "storage": {
      "storageSizeGB": "int"
    },
    "version": "string"
  }
}

属性值

flexibleServers

名字 描述 价值
类型 资源类型 “Microsoft.DBforPostgreSQL/flexibleServers”
apiVersion 资源 API 版本 '2022-12-01'
名字 资源名称 string (必需)
位置 资源所在的地理位置 string (必需)
标签 资源标记。 标记名称和值的字典。 请参阅模板 中的 标记
sku 服务器的 SKU(定价层)。 Sku
身份 描述应用程序的标识。 UserAssignedIdentity
性能 服务器的属性。 ServerProperties

UserAssignedIdentity

名字 描述 价值
类型 与此资源关联的标识类型;当前限制为“None 和 UserAssigned” “None”
“UserAssigned”(必需)
userAssignedIdentities 表示用户分配的标识映射。 UserAssignedIdentityMap

UserAssignedIdentityMap

名字 描述 价值
{自定义属性} UserIdentity

UserIdentity

名字 描述 价值
clientId 此标识表示的服务主体的客户端标识符。 字符串
principalId 此标识表示的服务主体的对象标识符。 字符串

ServerProperties

名字 描述 价值
administratorLogin 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 字符串
administratorLoginPassword 管理员登录密码(创建服务器时需要)。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 服务器的 AuthConfig 属性。 AuthConfig
availabilityZone 服务器的可用性区域信息。 字符串
备份 服务器的备份属性。 备份
createMode 创建新的 PostgreSQL 服务器的模式。 “Create”
“Default”
“GeoRestore”
“PointInTimeRestore”
“Replica”
“Update”
dataEncryption 服务器的数据加密属性。 DataEncryption
highAvailability 服务器的高可用性属性。 HighAvailability
maintenanceWindow 服务器的维护时段属性。 MaintenanceWindow
网络 服务器的网络属性。 仅当希望服务器成为专用访问服务器时,才需要传递此网络属性。 网络
pointInTimeUTC 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 字符串
replicationRole 服务器的复制角色 “AsyncReplica”
“GeoAsyncReplica”
“None”
“Primary”
sourceServerResourceId 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 此属性仅针对副本服务器返回 字符串
存储 服务器的存储属性。 存储
版本 PostgreSQL 服务器版本。 '11'
'12'
'13'
'14'

AuthConfig

名字 描述 价值
activeDirectoryAuth 如果已启用,则会启用 Azure Active Directory 身份验证。 “Disabled”
“Enabled”
passwordAuth 如果已启用,则启用密码身份验证。 “Disabled”
“Enabled”
tenantId 服务器的租户 ID。 字符串

备份

名字 描述 价值
backupRetentionDays 服务器的备份保留日。 int
geoRedundantBackup 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 “Disabled”
“Enabled”

DataEncryption

名字 描述 价值
primaryKeyURI 主服务器数据加密密钥的 URI。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 用于描述其是否为系统托管与 Azure Key Vault 的数据加密类型。 “AzureKeyVault”
“SystemManaged”

HighAvailability

名字 描述 价值
模式 服务器的 HA 模式。 “Disabled”
“SameZone”
“ZoneRedundant”
standbyAvailabilityZone 备用服务器的可用性区域信息。 字符串

MaintenanceWindow

名字 描述 价值
customWindow 指示是启用还是禁用自定义窗口 字符串
dayOfWeek 维护时段的星期几 int
startHour 维护时段的开始时间 int
startMinute 维护时段的开始时间 int

网络

名字 描述 价值
delegatedSubnetResourceId 委派的子网 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串
privateDnsZoneArmResourceId 专用 dns 区域 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串

存储

名字 描述 价值
storageSizeGB 服务器允许的最大存储。 int

Sku

名字 描述 价值
名字 SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 string (必需)
特定 SKU 的层,例如可突发。 “可突发”
“GeneralPurpose”
“MemoryOptimized”(必需)

快速入门模板

以下快速入门模板部署此资源类型。

模板 描述
使用 AAD 部署 Azure Database for PostgreSQL(灵活)

部署到 Azure
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 AAD 集成的方法。
使用 VNet 部署 Azure Database for PostgreSQL (灵活)

部署到 Azure
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 VNet 集成的方法。
使用 PostgreSQL 和 VNet 集成的 Web 应用 SonarQube

部署到 Azure
此模板提供使用 PostgreSQL 灵活服务器、VNet 集成和专用 DNS 轻松将 SonarQube 部署到 Linux 上的 Web 应用。

Terraform (AzAPI 提供程序)资源定义

可以使用目标操作部署 flexibleServers 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type =  "UserAssigned"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      administratorLogin = "string"
      administratorLoginPassword = "string"
      authConfig = {
        activeDirectoryAuth = "string"
        passwordAuth = "string"
        tenantId = "string"
      }
      availabilityZone = "string"
      backup = {
        backupRetentionDays = int
        geoRedundantBackup = "string"
      }
      createMode = "string"
      dataEncryption = {
        primaryKeyURI = "string"
        primaryUserAssignedIdentityId = "string"
        type = "string"
      }
      highAvailability = {
        mode = "string"
        standbyAvailabilityZone = "string"
      }
      maintenanceWindow = {
        customWindow = "string"
        dayOfWeek = int
        startHour = int
        startMinute = int
      }
      network = {
        delegatedSubnetResourceId = "string"
        privateDnsZoneArmResourceId = "string"
      }
      pointInTimeUTC = "string"
      replicationRole = "string"
      sourceServerResourceId = "string"
      storage = {
        storageSizeGB = int
      }
      version = "string"
    }
    sku = {
      name = "string"
      tier = "string"
    }
  })
}

属性值

flexibleServers

名字 描述 价值
类型 资源类型 “Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01”
名字 资源名称 string (必需)
位置 资源所在的地理位置 string (必需)
parent_id 若要部署到资源组,请使用该资源组的 ID。 string (必需)
标签 资源标记。 标记名称和值的字典。
sku 服务器的 SKU(定价层)。 Sku
身份 描述应用程序的标识。 UserAssignedIdentity
性能 服务器的属性。 ServerProperties

UserAssignedIdentity

名字 描述 价值
类型 与此资源关联的标识类型;当前限制为“None 和 UserAssigned” “UserAssigned”(必需)
identity_ids 表示用户分配的标识映射。 用户标识 ID 的数组。

UserAssignedIdentityMap

名字 描述 价值
{自定义属性} UserIdentity

UserIdentity

名字 描述 价值
clientId 此标识表示的服务主体的客户端标识符。 字符串
principalId 此标识表示的服务主体的对象标识符。 字符串

ServerProperties

名字 描述 价值
administratorLogin 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 字符串
administratorLoginPassword 管理员登录密码(创建服务器时需要)。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 服务器的 AuthConfig 属性。 AuthConfig
availabilityZone 服务器的可用性区域信息。 字符串
备份 服务器的备份属性。 备份
createMode 创建新的 PostgreSQL 服务器的模式。 “创建”
“Default”
“GeoRestore”
“PointInTimeRestore”
“Replica”
“更新”
dataEncryption 服务器的数据加密属性。 DataEncryption
highAvailability 服务器的高可用性属性。 HighAvailability
maintenanceWindow 服务器的维护时段属性。 MaintenanceWindow
网络 服务器的网络属性。 仅当希望服务器成为专用访问服务器时,才需要传递此网络属性。 网络
pointInTimeUTC 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 字符串
replicationRole 服务器的复制角色 “AsyncReplica”
“GeoAsyncReplica”
“None”
“Primary”
sourceServerResourceId 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 此属性仅针对副本服务器返回 字符串
存储 服务器的存储属性。 存储
版本 PostgreSQL 服务器版本。 "11"
"12"
"13"
"14"

AuthConfig

名字 描述 价值
activeDirectoryAuth 如果已启用,则会启用 Azure Active Directory 身份验证。 “Disabled”
“已启用”
passwordAuth 如果已启用,则启用密码身份验证。 “Disabled”
“已启用”
tenantId 服务器的租户 ID。 字符串

备份

名字 描述 价值
backupRetentionDays 服务器的备份保留日。 int
geoRedundantBackup 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 “Disabled”
“已启用”

DataEncryption

名字 描述 价值
primaryKeyURI 主服务器数据加密密钥的 URI。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 用于描述其是否为系统托管与 Azure Key Vault 的数据加密类型。 “AzureKeyVault”
“SystemManaged”

HighAvailability

名字 描述 价值
模式 服务器的 HA 模式。 “Disabled”
“SameZone”
“ZoneRedundant”
standbyAvailabilityZone 备用服务器的可用性区域信息。 字符串

MaintenanceWindow

名字 描述 价值
customWindow 指示是启用还是禁用自定义窗口 字符串
dayOfWeek 维护时段的星期几 int
startHour 维护时段的开始时间 int
startMinute 维护时段的开始时间 int

网络

名字 描述 价值
delegatedSubnetResourceId 委派的子网 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串
privateDnsZoneArmResourceId 专用 dns 区域 arm 资源 ID。在创建过程中需要传递此项,以防我们希望服务器注入 VNET,即专用访问服务器。 在更新期间,仅当我们想要更新专用 DNS 区域的值时,才传递此值。 字符串

存储

名字 描述 价值
storageSizeGB 服务器允许的最大存储。 int

Sku

名字 描述 价值
名字 SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 string (必需)
特定 SKU 的层,例如可突发。 “可突发”
“GeneralPurpose”
“MemoryOptimized”(必需)