Servers - Create
Creates a new server.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2021-06-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| location | True |
string |
The geo-location where the resource lives |
| properties.administratorLogin |
string |
The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
|
| properties.administratorLoginPassword |
string (password) |
The administrator login password (required for server creation). |
|
| properties.availabilityZone |
string |
availability zone information of the server. |
|
| properties.backup |
Backup properties of a server. |
||
| properties.createMode |
The mode to create a new PostgreSQL server. |
||
| properties.highAvailability |
High availability properties of a server. |
||
| properties.maintenanceWindow |
Maintenance window properties of a server. |
||
| properties.network |
Network properties of a server. |
||
| properties.pointInTimeUTC |
string (date-time) |
Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore'. |
|
| properties.sourceServerResourceId |
string (arm-id) |
The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore'. |
|
| properties.storage |
Storage properties of a server. |
||
| properties.version |
PostgreSQL Server version. |
||
| sku |
The SKU (pricing tier) of the server. |
||
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
OK |
|
| 201 Created |
Created |
|
| 202 Accepted |
Accepted |
|
| Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
| Create a database as a point in time restore |
| Create a new server |
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=2021-06-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
},
"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
},
"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=2021-06-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",
"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",
"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"
}
Definitions
| Name | Description |
|---|---|
| Backup |
Backup properties of a server |
|
Cloud |
An error response from the Batch service. |
|
created |
The type of identity that created the resource. |
|
Create |
The mode to create a new PostgreSQL server. |
|
Error |
The resource management error additional info. |
|
Error |
Error Response |
|
Geo |
A value indicating whether Geo-Redundant backup is enabled on the server. |
|
High |
High availability properties of a server |
|
High |
The HA mode for the server. |
|
Maintenance |
Maintenance window properties of a server. |
| Network |
Network properties of a server |
| Server |
Represents a server. |
|
Server |
A state of a HA server that is visible to user. |
|
Server |
public network access is enabled or not |
|
Server |
A state of a server that is visible to user. |
|
Server |
The version of a server. |
| Sku |
Sku information related properties of a server. |
|
Sku |
The tier of the particular SKU, e.g. Burstable. |
| Storage |
Storage properties of a server |
|
system |
Metadata pertaining to creation and last modification of the resource. |
Backup
Backup properties of a server
| Name | Type | Default value | Description |
|---|---|---|---|
| backupRetentionDays |
integer (int32) |
7 |
Backup retention days for the server. |
| earliestRestoreDate |
string (date-time) |
The earliest restore point time (ISO8601 format) for server. |
|
| geoRedundantBackup | Disabled |
A value indicating whether Geo-Redundant backup is enabled on the server. |
CloudError
An error response from the Batch service.
| Name | Type | Description |
|---|---|---|
| error |
Error Response |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CreateMode
The mode to create a new PostgreSQL server.
| Value | Description |
|---|---|
| Default | |
| Create | |
| Update | |
| PointInTimeRestore |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorResponse
Error Response
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
GeoRedundantBackupEnum
A value indicating whether Geo-Redundant backup is enabled on the server.
| Value | Description |
|---|---|
| Enabled | |
| Disabled |
HighAvailability
High availability properties of a server
| Name | Type | Default value | Description |
|---|---|---|---|
| mode | Disabled |
The HA mode for the server. |
|
| standbyAvailabilityZone |
string |
availability zone information of the standby. |
|
| state |
A state of a HA server that is visible to user. |
HighAvailabilityMode
The HA mode for the server.
| Value | Description |
|---|---|
| Disabled | |
| ZoneRedundant |
MaintenanceWindow
Maintenance window properties of a server.
| Name | Type | Default value | Description |
|---|---|---|---|
| customWindow |
string |
Disabled |
indicates whether custom window is enabled or disabled |
| dayOfWeek |
integer (int32) |
0 |
day of week for maintenance window |
| startHour |
integer (int32) |
0 |
start hour for maintenance window |
| startMinute |
integer (int32) |
0 |
start minute for maintenance window |
Network
Network properties of a server
| Name | Type | Description |
|---|---|---|
| delegatedSubnetResourceId |
string (arm-id) |
delegated subnet arm resource id. |
| privateDnsZoneArmResourceId |
string (arm-id) |
private dns zone arm resource id. |
| publicNetworkAccess |
public network access is enabled or not |
Server
Represents a server.
| Name | Type | Description |
|---|---|---|
| id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.administratorLogin |
string |
The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). |
| properties.administratorLoginPassword |
string (password) |
The administrator login password (required for server creation). |
| properties.availabilityZone |
string |
availability zone information of the server. |
| properties.backup |
Backup properties of a server. |
|
| properties.createMode |
The mode to create a new PostgreSQL server. |
|
| properties.fullyQualifiedDomainName |
string |
The fully qualified domain name of a server. |
| properties.highAvailability |
High availability properties of a server. |
|
| properties.maintenanceWindow |
Maintenance window properties of a server. |
|
| properties.minorVersion |
string |
The minor version of the server. |
| properties.network |
Network properties of a server. |
|
| properties.pointInTimeUTC |
string (date-time) |
Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore'. |
| properties.sourceServerResourceId |
string (arm-id) |
The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore'. |
| properties.state |
A state of a server that is visible to user. |
|
| properties.storage |
Storage properties of a server. |
|
| properties.version |
PostgreSQL Server version. |
|
| sku |
The SKU (pricing tier) of the server. |
|
| systemData |
The system metadata relating to this resource. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
ServerHAState
A state of a HA server that is visible to user.
| Value | Description |
|---|---|
| NotEnabled | |
| CreatingStandby | |
| ReplicatingData | |
| FailingOver | |
| Healthy | |
| RemovingStandby |
ServerPublicNetworkAccessState
public network access is enabled or not
| Value | Description |
|---|---|
| Enabled | |
| Disabled |
ServerState
A state of a server that is visible to user.
| Value | Description |
|---|---|
| Ready | |
| Dropping | |
| Disabled | |
| Starting | |
| Stopping | |
| Stopped | |
| Updating |
ServerVersion
The version of a server.
| Value | Description |
|---|---|
| 14 | |
| 13 | |
| 12 | |
| 11 |
Sku
Sku information related properties of a server.
| Name | Type | Description |
|---|---|---|
| name |
string |
The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. |
| tier |
The tier of the particular SKU, e.g. Burstable. |
SkuTier
The tier of the particular SKU, e.g. Burstable.
| Value | Description |
|---|---|
| Burstable | |
| GeneralPurpose | |
| MemoryOptimized |
Storage
Storage properties of a server
| Name | Type | Description |
|---|---|---|
| storageSizeGB |
integer (int32) |
Max storage allowed for a server. |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |