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

Servers - Create

创建新服务器。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2022-12-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

serverName
path True

string

服务器的名称。

正则表达式模式: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

subscriptionId
path True

string

目标订阅的 ID。

api-version
query True

string

要用于此操作的 API 版本。

请求正文

名称 类型 说明
parameters

Server

创建或更新服务器所需的参数。

响应

名称 类型 说明
200 OK

Server

确定

201 Created

Server

创建

202 Accepted

已接受

标头

Location: string

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create a database as a geo-restore in geo-paired location
Create a database as a point in time restore
Create a new server
Create a new server with active directory authentication enabled
ServerCreateReplica
ServerCreateWithDataEncryptionEnabled

Create a database as a geo-restore in geo-paired location

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo?api-version=2022-12-01

{
  "location": "eastus",
  "properties": {
    "createMode": "GeoRestore",
    "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
    "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5geo.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Enabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "eastus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo",
  "name": "pgtestsvc5geo",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5geo.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Enabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "eastus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo",
  "name": "pgtestsvc5geo",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

Create a database as a point in time restore

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5?api-version=2022-12-01

{
  "location": "westus",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
    "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5",
  "name": "pgtestsvc5",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5",
  "name": "pgtestsvc5",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

Create a new server

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4?api-version=2022-12-01

{
  "location": "westus",
  "sku": {
    "tier": "GeneralPurpose",
    "name": "Standard_D4s_v3"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "administratorLoginPassword": "password",
    "version": "12",
    "availabilityZone": "1",
    "createMode": "Create",
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled"
    },
    "network": {
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant"
    }
  },
  "tags": {
    "ElasticServer": "1"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

Create a new server with active directory authentication enabled

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4?api-version=2022-12-01

{
  "location": "westus",
  "sku": {
    "tier": "GeneralPurpose",
    "name": "Standard_D4s_v3"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "administratorLoginPassword": "password",
    "version": "12",
    "availabilityZone": "1",
    "createMode": "Create",
    "authConfig": {
      "activeDirectoryAuth": "Enabled",
      "passwordAuth": "Enabled",
      "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled"
    },
    "network": {
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant"
    }
  },
  "tags": {
    "ElasticServer": "1"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "authConfig": {
      "activeDirectoryAuth": "Enabled",
      "passwordAuth": "Enabled",
      "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "authConfig": {
      "activeDirectoryAuth": "Enabled",
      "passwordAuth": "Enabled",
      "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

ServerCreateReplica

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep?api-version=2022-12-01

{
  "location": "westus",
  "properties": {
    "createMode": "Replica",
    "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
    "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5rep.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    },
    "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
    "replicationRole": "AsyncReplica",
    "replicaCapacity": 0
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep",
  "name": "pgtestsvc5rep",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "properties": {
    "fullyQualifiedDomainName": "pgtestsvc5rep.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "2",
    "storage": {
      "storageSizeGB": 512
    },
    "dataEncryption": {
      "type": "SystemManaged"
    },
    "authConfig": {
      "activeDirectoryAuth": "Disabled",
      "passwordAuth": "Enabled"
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-27T00:28:17.7279547+00:00"
    },
    "network": {
      "publicNetworkAccess": "Enabled"
    },
    "highAvailability": {
      "mode": "Disabled",
      "state": "NotEnabled"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    },
    "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
    "replicationRole": "AsyncReplica",
    "replicaCapacity": 0
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep",
  "name": "pgtestsvc5rep",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

ServerCreateWithDataEncryptionEnabled

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4?api-version=2022-12-01

{
  "location": "westus",
  "sku": {
    "tier": "GeneralPurpose",
    "name": "Standard_D4s_v3"
  },
  "identity": {
    "userAssignedIdentities": {
      "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}
    },
    "type": "UserAssigned"
  },
  "properties": {
    "administratorLogin": "cloudsa",
    "administratorLoginPassword": "password",
    "version": "12",
    "availabilityZone": "1",
    "createMode": "Create",
    "dataEncryption": {
      "type": "AzureKeyVault",
      "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
      "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled"
    },
    "network": {
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant"
    }
  },
  "tags": {
    "ElasticServer": "1"
  }
}

示例响应

{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "identity": {
    "userAssignedIdentities": {
      "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {
        "principalId": "0a4e0c6e-7751-4078-ae1f-a477306c11e9",
        "clientId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
      }
    },
    "type": "UserAssigned"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "authConfig": {
      "activeDirectoryAuth": "Enabled",
      "passwordAuth": "Enabled"
    },
    "dataEncryption": {
      "type": "AzureKeyVault",
      "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
      "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
{
  "sku": {
    "name": "Standard_D4s_v3",
    "tier": "GeneralPurpose"
  },
  "identity": {
    "userAssignedIdentities": {
      "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {
        "principalId": "0a4e0c6e-7751-4078-ae1f-a477306c11e9",
        "clientId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
      }
    },
    "type": "UserAssigned"
  },
  "properties": {
    "fullyQualifiedDomainName": "c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com",
    "version": "12",
    "minorVersion": "6",
    "administratorLogin": "cloudsa",
    "state": "Ready",
    "availabilityZone": "1",
    "authConfig": {
      "activeDirectoryAuth": "Enabled",
      "passwordAuth": "Enabled"
    },
    "dataEncryption": {
      "type": "AzureKeyVault",
      "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
      "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"
    },
    "storage": {
      "storageSizeGB": 512
    },
    "backup": {
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Disabled",
      "earliestRestoreDate": "2021-05-26T01:08:06.7197478+00:00"
    },
    "network": {
      "publicNetworkAccess": "Disabled",
      "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
      "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"
    },
    "highAvailability": {
      "mode": "ZoneRedundant",
      "state": "Healthy",
      "standbyAvailabilityZone": "2"
    },
    "maintenanceWindow": {
      "customWindow": "Disabled",
      "dayOfWeek": 0,
      "startHour": 0,
      "startMinute": 0
    }
  },
  "location": "westus",
  "tags": {
    "ElasticServer": "1"
  },
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4",
  "name": "pgtestsvc4",
  "type": "Microsoft.DBforPostgreSQL/flexibleServers"
}

定义

名称 说明
activeDirectoryAuthEnum

如果已启用,则启用 Azure Active Directory 身份验证。

ArmServerKeyType

数据加密类型,用于描述它是系统托管还是 Azure Key Vault。

AuthConfig

服务器的 AuthConfig 属性。

Backup

服务器的备份属性。

createdByType

创建资源的标识类型。

CreateMode

用于创建新的 PostgreSQL 服务器的模式。

DataEncryption

服务器的数据加密属性。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

GeoRedundantBackupEnum

一个 值,该值指示服务器上是否启用了 Geo-Redundant 备份。

HighAvailability

服务器的高可用性属性。

HighAvailabilityMode

服务器的 HA 模式。

IdentityType

与此资源关联的标识类型;当前限制为“None 和 UserAssigned”

MaintenanceWindow

服务器的维护时段属性。

Network

服务器的网络属性。 仅当希望服务器为专用访问服务器时,才需要传递此 Network 属性。

passwordAuthEnum

如果已启用,则启用密码身份验证。

ReplicationRole

服务器的复制角色

Server

表示服务器。

ServerHAState

对用户可见的 HA 服务器的状态。

ServerPublicNetworkAccessState

是否启用公用网络访问

ServerState

用户可见的服务器的状态。

ServerVersion

PostgreSQL 服务器版本。

Sku

服务器的 SKU (定价层) 。

SkuTier

特定 SKU 的层,例如可突发。

Storage

服务器的存储属性。

systemData

与此资源相关的系统元数据。

UserAssignedIdentity

描述应用程序的标识。

UserIdentity

描述与应用程序关联的单个用户分配标识。

activeDirectoryAuthEnum

如果已启用,则启用 Azure Active Directory 身份验证。

名称 类型 说明
Disabled

string

Enabled

string

ArmServerKeyType

数据加密类型,用于描述它是系统托管还是 Azure Key Vault。

名称 类型 说明
AzureKeyVault

string

SystemManaged

string

AuthConfig

服务器的 AuthConfig 属性。

名称 类型 默认值 说明
activeDirectoryAuth

activeDirectoryAuthEnum

如果已启用,则启用 Azure Active Directory 身份验证。

passwordAuth

passwordAuthEnum

Enabled

如果已启用,则启用密码身份验证。

tenantId

string

服务器的租户 ID。

Backup

服务器的备份属性。

名称 类型 默认值 说明
backupRetentionDays

integer

7

服务器的备份保留天数。

earliestRestoreDate

string

服务器的最早还原点时间 (ISO8601) 格式。

geoRedundantBackup

GeoRedundantBackupEnum

Disabled

一个 值,该值指示服务器上是否启用了 Geo-Redundant 备份。

createdByType

创建资源的标识类型。

名称 类型 说明
Application

string

Key

string

ManagedIdentity

string

User

string

CreateMode

用于创建新的 PostgreSQL 服务器的模式。

名称 类型 说明
Create

string

Default

string

GeoRestore

string

PointInTimeRestore

string

Replica

string

Update

string

DataEncryption

服务器的数据加密属性。

名称 类型 说明
primaryKeyURI

string

主服务器数据加密密钥的 URI。

primaryUserAssignedIdentityId

string

要用于主服务器数据加密的用户分配标识的资源 ID。

type

ArmServerKeyType

数据加密类型,用于描述它是系统托管还是 Azure Key Vault。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

GeoRedundantBackupEnum

一个 值,该值指示服务器上是否启用了 Geo-Redundant 备份。

名称 类型 说明
Disabled

string

Enabled

string

HighAvailability

服务器的高可用性属性。

名称 类型 默认值 说明
mode

HighAvailabilityMode

Disabled

服务器的 HA 模式。

standbyAvailabilityZone

string

备用服务器的可用性区域信息。

state

ServerHAState

对用户可见的 HA 服务器的状态。

HighAvailabilityMode

服务器的 HA 模式。

名称 类型 说明
Disabled

string

SameZone

string

ZoneRedundant

string

IdentityType

与此资源关联的标识类型;当前限制为“None 和 UserAssigned”

名称 类型 说明
None

string

UserAssigned

string

MaintenanceWindow

服务器的维护时段属性。

名称 类型 默认值 说明
customWindow

string

Disabled

指示是启用或禁用自定义窗口

dayOfWeek

integer

0

维护时段的星期数

startHour

integer

0

维护时段的开始时间

startMinute

integer

0

维护时段的开始分钟数

Network

服务器的网络属性。 仅当希望服务器为专用访问服务器时,才需要传递此 Network 属性。

名称 类型 说明
delegatedSubnetResourceId

string

委托的子网 arm 资源 ID。如果我们希望服务器注入 VNET(即专用访问服务器),则需要在创建过程中传递此项。 在更新期间,仅当我们想要更新专用 DNS区域的值时,才传递此项。

privateDnsZoneArmResourceId

string

专用 DNS 区域 arm 资源 ID。如果我们希望服务器注入 VNET(即专用访问服务器),则需要在创建过程中传递此项。 在更新期间,仅当我们想要更新专用 DNS区域的值时,才传递此项。

publicNetworkAccess

ServerPublicNetworkAccessState

是否启用公用网络访问

passwordAuthEnum

如果已启用,则启用密码身份验证。

名称 类型 说明
Disabled

string

Enabled

string

ReplicationRole

服务器的复制角色

名称 类型 说明
AsyncReplica

string

GeoAsyncReplica

string

None

string

Primary

string

Server

表示服务器。

名称 类型 说明
id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

UserAssignedIdentity

描述应用程序的标识。

location

string

资源所在的地理位置

name

string

资源的名称

properties.administratorLogin

string

服务器的管理员登录名。 只能在 (创建服务器时指定,并且需要创建) 。

properties.administratorLoginPassword

string

创建服务器) (管理员登录密码。

properties.authConfig

AuthConfig

服务器的 AuthConfig 属性。

properties.availabilityZone

string

服务器的可用性区域信息。

properties.backup

Backup

服务器的备份属性。

properties.createMode

CreateMode

用于创建新的 PostgreSQL 服务器的模式。

properties.dataEncryption

DataEncryption

服务器的数据加密属性。

properties.fullyQualifiedDomainName

string

服务器的完全限定域名。

properties.highAvailability

HighAvailability

服务器的高可用性属性。

properties.maintenanceWindow

MaintenanceWindow

服务器的维护时段属性。

properties.minorVersion

string

服务器的次要版本。

properties.network

Network

服务器的网络属性。 仅当希望服务器为专用访问服务器时,才需要传递此 Network 属性。

properties.pointInTimeUTC

string

还原点创建时间 (ISO8601 格式) ,指定要从其还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,这是必需的。

properties.replicaCapacity

integer

服务器允许的副本。

properties.replicationRole

ReplicationRole

服务器的复制角色

properties.sourceServerResourceId

string

要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”、“GeoRestore”或“Replica”时,这是必需的。 此属性仅为副本服务器返回

properties.state

ServerState

用户可见的服务器的状态。

properties.storage

Storage

服务器的存储属性。

properties.version

ServerVersion

PostgreSQL 服务器版本。

sku

Sku

服务器的 SKU (定价层) 。

systemData

systemData

与此资源相关的系统元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

ServerHAState

对用户可见的 HA 服务器的状态。

名称 类型 说明
CreatingStandby

string

FailingOver

string

Healthy

string

NotEnabled

string

RemovingStandby

string

ReplicatingData

string

ServerPublicNetworkAccessState

是否启用公用网络访问

名称 类型 说明
Disabled

string

Enabled

string

ServerState

用户可见的服务器的状态。

名称 类型 说明
Disabled

string

Dropping

string

Ready

string

Starting

string

Stopped

string

Stopping

string

Updating

string

ServerVersion

PostgreSQL 服务器版本。

名称 类型 说明
11

string

12

string

13

string

14

string

Sku

服务器的 SKU (定价层) 。

名称 类型 说明
name

string

sku 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。

tier

SkuTier

特定 SKU 的层,例如可突发。

SkuTier

特定 SKU 的层,例如可突发。

名称 类型 说明
Burstable

string

GeneralPurpose

string

MemoryOptimized

string

Storage

服务器的存储属性。

名称 类型 说明
storageSizeGB

integer

服务器允许的最大存储。

systemData

与此资源相关的系统元数据。

名称 类型 说明
createdAt

string

资源创建时间戳 (UTC) 。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识类型。

lastModifiedAt

string

资源上次修改的时间戳 (UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识类型。

UserAssignedIdentity

描述应用程序的标识。

名称 类型 说明
tenantId

string

服务器的租户 ID。

type

IdentityType

与此资源关联的标识类型;当前限制为“None 和 UserAssigned”

userAssignedIdentities

<string,  UserIdentity>

表示用户分配的标识映射。

UserIdentity

描述与应用程序关联的单个用户分配标识。

名称 类型 说明
clientId

string

此标识表示的服务主体的客户端标识符。

principalId

string

此标识表示的服务主体的对象标识符。