Share via


Servers - Create

建立新的伺服器。

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

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

資源群組的名稱。 名稱不區分大小寫。

serverName
path True

string

伺服器的名稱。

Regex pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

subscriptionId
path True

string

目標訂用帳戶的標識碼。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 類型 Description
parameters

Server

建立或更新伺服器所需的參數。

回應

名稱 類型 Description
200 OK

Server

確定

201 Created

Server

建立時間

202 Accepted

已接受

Headers

Location: string

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
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

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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"
}

定義

名稱 Description
activeDirectoryAuthEnum

如果已啟用,則會啟用 Azure Active Directory 驗證。

ArmServerKeyType

要描述其是否為系統管理與 Azure 金鑰保存庫的數據加密類型。

AuthConfig

伺服器的 AuthConfig 屬性。

Backup

伺服器的備份屬性。

createdByType

建立資源的身分識別類型。

CreateMode

建立新 PostgreSQL 伺服器的模式。

DataEncryption

伺服器的數據加密屬性。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

GeoRedundantBackupEnum

值,指出伺服器上是否啟用 Geo-Redundant 備份。

HighAvailability

伺服器的高可用性屬性。

HighAvailabilityMode

伺服器的HA模式。

IdentityType

與此資源相關聯的身分識別類型;目前限制為「無」和「UserAssigned」

MaintenanceWindow

伺服器的維護視窗屬性。

Network

伺服器的網路屬性。 只有在您想要讓伺服器成為私人存取伺服器時,才需要傳遞這個 Network 屬性。

passwordAuthEnum

如果已啟用,則會啟用密碼驗證。

ReplicationRole

伺服器的復寫角色

Server

表示伺服器。

ServerHAState

使用者可以看到的HA伺服器狀態。

ServerPublicNetworkAccessState

公用網路存取已啟用或未啟用

ServerState

使用者可以看到的伺服器狀態。

ServerVersion

PostgreSQL Server 版本。

Sku

伺服器的 SKU (定價層) 。

SkuTier

特定 SKU 的層,例如高載。

Storage

伺服器的記憶體屬性。

systemData

與此資源相關的系統元數據。

UserAssignedIdentity

描述應用程式的身分識別。

UserIdentity

描述與應用程式相關聯的單一使用者指派身分識別。

activeDirectoryAuthEnum

如果已啟用,則會啟用 Azure Active Directory 驗證。

名稱 類型 Description
Disabled

string

Enabled

string

ArmServerKeyType

要描述其是否為系統管理與 Azure 金鑰保存庫的數據加密類型。

名稱 類型 Description
AzureKeyVault

string

SystemManaged

string

AuthConfig

伺服器的 AuthConfig 屬性。

名稱 類型 預設值 Description
activeDirectoryAuth

activeDirectoryAuthEnum

如果已啟用,則會啟用 Azure Active Directory 驗證。

passwordAuth

passwordAuthEnum

Enabled

如果已啟用,則會啟用密碼驗證。

tenantId

string

伺服器的租用戶標識碼。

Backup

伺服器的備份屬性。

名稱 類型 預設值 Description
backupRetentionDays

integer

7

伺服器的備份保留天數。

earliestRestoreDate

string

伺服器最早的還原時間點時間 (ISO8601 格式) 。

geoRedundantBackup

GeoRedundantBackupEnum

Disabled

值,指出伺服器上是否啟用 Geo-Redundant 備份。

createdByType

建立資源的身分識別類型。

名稱 類型 Description
Application

string

Key

string

ManagedIdentity

string

User

string

CreateMode

建立新 PostgreSQL 伺服器的模式。

名稱 類型 Description
Create

string

Default

string

GeoRestore

string

PointInTimeRestore

string

Replica

string

Update

string

DataEncryption

伺服器的數據加密屬性。

名稱 類型 Description
primaryKeyURI

string

主伺服器數據加密金鑰的 URI。

primaryUserAssignedIdentityId

string

要用於主伺服器數據加密的使用者指派身分識別的資源識別碼。

type

ArmServerKeyType

要描述其是否為系統管理與 Azure 金鑰保存庫的數據加密類型。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細資料。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

GeoRedundantBackupEnum

值,指出伺服器上是否啟用 Geo-Redundant 備份。

名稱 類型 Description
Disabled

string

Enabled

string

HighAvailability

伺服器的高可用性屬性。

名稱 類型 預設值 Description
mode

HighAvailabilityMode

Disabled

伺服器的HA模式。

standbyAvailabilityZone

string

待命的可用性區域資訊。

state

ServerHAState

使用者可以看到的HA伺服器狀態。

HighAvailabilityMode

伺服器的HA模式。

名稱 類型 Description
Disabled

string

SameZone

string

ZoneRedundant

string

IdentityType

與此資源相關聯的身分識別類型;目前限制為「無」和「UserAssigned」

名稱 類型 Description
None

string

UserAssigned

string

MaintenanceWindow

伺服器的維護視窗屬性。

名稱 類型 預設值 Description
customWindow

string

Disabled

指出是否啟用或停用自定義視窗

dayOfWeek

integer

0

維護時段的星期數

startHour

integer

0

維護時段的開始時間

startMinute

integer

0

維護時段的開始分鐘

Network

伺服器的網路屬性。 只有在您想要讓伺服器成為私人存取伺服器時,才需要傳遞這個 Network 屬性。

名稱 類型 Description
delegatedSubnetResourceId

string

委派的子網 arm 資源標識符。這是在建立期間必須傳遞的,以防我們想要將伺服器插入 VNET,也就是私人存取伺服器。 在更新期間,只有在我們想要更新 私用 DNS 區域的值時,才傳遞此值。

privateDnsZoneArmResourceId

string

私人 dns 區域 arm 資源識別碼。這是在建立期間必須傳遞的,以防我們想要將伺服器插入 VNET,也就是私人存取伺服器。 在更新期間,只有在我們想要更新 私用 DNS 區域的值時,才傳遞此值。

publicNetworkAccess

ServerPublicNetworkAccessState

公用網路存取已啟用或未啟用

passwordAuthEnum

如果已啟用,則會啟用密碼驗證。

名稱 類型 Description
Disabled

string

Enabled

string

ReplicationRole

伺服器的復寫角色

名稱 類型 Description
AsyncReplica

string

GeoAsyncReplica

string

None

string

Primary

string

Server

表示伺服器。

名稱 類型 Description
id

string

資源的完整資源識別碼。 Ex - /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

要從中還原的來源伺服器資源標識碼。 當 'createMode' 是 'PointInTimeRestore' 或 'GeoRestore' 或 'Replica' 時,就是必要的。 這個屬性只會針對復本伺服器傳回

properties.state

ServerState

使用者可以看到的伺服器狀態。

properties.storage

Storage

伺服器的記憶體屬性。

properties.version

ServerVersion

PostgreSQL Server 版本。

sku

Sku

伺服器的 SKU (定價層) 。

systemData

systemData

與此資源相關的系統元數據。

tags

object

資源標籤。

type

string

資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

ServerHAState

使用者可以看到的HA伺服器狀態。

名稱 類型 Description
CreatingStandby

string

FailingOver

string

Healthy

string

NotEnabled

string

RemovingStandby

string

ReplicatingData

string

ServerPublicNetworkAccessState

公用網路存取已啟用或未啟用

名稱 類型 Description
Disabled

string

Enabled

string

ServerState

使用者可以看到的伺服器狀態。

名稱 類型 Description
Disabled

string

Dropping

string

Ready

string

Starting

string

Stopped

string

Stopping

string

Updating

string

ServerVersion

PostgreSQL Server 版本。

名稱 類型 Description
11

string

12

string

13

string

14

string

Sku

伺服器的 SKU (定價層) 。

名稱 類型 Description
name

string

sku 的名稱,通常是層 + 系列 + 核心,例如Standard_D4s_v3。

tier

SkuTier

特定 SKU 的層,例如高載。

SkuTier

特定 SKU 的層,例如高載。

名稱 類型 Description
Burstable

string

GeneralPurpose

string

MemoryOptimized

string

Storage

伺服器的記憶體屬性。

名稱 類型 Description
storageSizeGB

integer

伺服器允許的最大記憶體。

systemData

與此資源相關的系統元數據。

名稱 類型 Description
createdAt

string

資源建立的時間戳 (UTC) 。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。

UserAssignedIdentity

描述應用程式的身分識別。

名稱 類型 Description
tenantId

string

伺服器的租用戶標識碼。

type

IdentityType

與此資源相關聯的身分識別類型;目前限制為「無」和「UserAssigned」

userAssignedIdentities

<string,  UserIdentity>

代表使用者指派的身分識別對應。

UserIdentity

描述與應用程式相關聯的單一使用者指派身分識別。

名稱 類型 Description
clientId

string

此身分識別所代表之服務主體的用戶端標識碼。

principalId

string

此身分識別所代表之服務主體的物件標識碼。