servers
Creates, updates, deletes, gets or lists a servers resource.
Overview
| Name | servers |
| Type | Resource |
| Id | azure.postgresql_flexible_servers.servers |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Name of the login designated as the first password based administrator assigned to your instance of PostgreSQL. Must be specified the first time that you enable password based authentication on a server. Once set to a given value, it cannot be changed for the rest of the life of a server. If you disable password based authentication on a server which had it enabled, this password based role isn't deleted. |
administratorLoginPassword | string | Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed at any time. |
authConfig | object | Authentication configuration properties of a server. |
availabilityZone | string | Availability zone of a server. |
backup | object | Backup properties of a server. |
cluster | object | Cluster properties of a server. |
createMode | string | Creation mode of a new server. Known values are: "Default", "Create", "Update", "PointInTimeRestore", "GeoRestore", "Replica", and "ReviveDropped". (Default, Create, Update, PointInTimeRestore, GeoRestore, Replica, ReviveDropped) |
dataEncryption | object | Data encryption properties of a server. |
fullyQualifiedDomainName | string | Fully qualified domain name of a server. |
highAvailability | object | High availability properties of a server. |
identity | object | User assigned managed identities assigned to the server. |
location | string | The geo-location where the resource lives. Required. |
maintenanceWindow | object | Maintenance window properties of a server. |
minorVersion | string | Minor version of PostgreSQL database engine. |
network | object | Network properties of a server. Only required if you want your server to be integrated into a virtual network provided by customer. |
pointInTimeUTC | string (date-time) | Creation time (in ISO8601 format) of the backup which you want to restore in the new server. It's required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'. |
privateEndpointConnections | array | List of private endpoint connections associated with the specified server. |
replica | object | Read replica properties of a server. Required only in case that you want to promote a server. |
replicaCapacity | integer | Maximum number of read replicas allowed for a server. |
replicationRole | string | Role of the server in a replication set. Known values are: "None", "Primary", "AsyncReplica", and "GeoAsyncReplica". (None, Primary, AsyncReplica, GeoAsyncReplica) |
sku | object | Compute tier and size of a server. |
sourceServerResourceId | string | Identifier of the server to be used as the source of the new server. Required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is returned only when the target server is a read replica. |
state | string | Possible states of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", "Updating", "Restarting", "Inaccessible", and "Provisioning". (Ready, Dropping, Disabled, Starting, Stopping, Stopped, Updating, Restarting, Inaccessible, Provisioning) |
storage | object | Storage properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major version of PostgreSQL database engine. Known values are: "18", "17", "16", "15", "14", "13", "12", and "11". (18, 17, 16, 15, 14, 13, 12, 11) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Name of the login designated as the first password based administrator assigned to your instance of PostgreSQL. Must be specified the first time that you enable password based authentication on a server. Once set to a given value, it cannot be changed for the rest of the life of a server. If you disable password based authentication on a server which had it enabled, this password based role isn't deleted. |
administratorLoginPassword | string | Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed at any time. |
authConfig | object | Authentication configuration properties of a server. |
availabilityZone | string | Availability zone of a server. |
backup | object | Backup properties of a server. |
cluster | object | Cluster properties of a server. |
createMode | string | Creation mode of a new server. Known values are: "Default", "Create", "Update", "PointInTimeRestore", "GeoRestore", "Replica", and "ReviveDropped". (Default, Create, Update, PointInTimeRestore, GeoRestore, Replica, ReviveDropped) |
dataEncryption | object | Data encryption properties of a server. |
fullyQualifiedDomainName | string | Fully qualified domain name of a server. |
highAvailability | object | High availability properties of a server. |
identity | object | User assigned managed identities assigned to the server. |
location | string | The geo-location where the resource lives. Required. |
maintenanceWindow | object | Maintenance window properties of a server. |
minorVersion | string | Minor version of PostgreSQL database engine. |
network | object | Network properties of a server. Only required if you want your server to be integrated into a virtual network provided by customer. |
pointInTimeUTC | string (date-time) | Creation time (in ISO8601 format) of the backup which you want to restore in the new server. It's required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'. |
privateEndpointConnections | array | List of private endpoint connections associated with the specified server. |
replica | object | Read replica properties of a server. Required only in case that you want to promote a server. |
replicaCapacity | integer | Maximum number of read replicas allowed for a server. |
replicationRole | string | Role of the server in a replication set. Known values are: "None", "Primary", "AsyncReplica", and "GeoAsyncReplica". (None, Primary, AsyncReplica, GeoAsyncReplica) |
sku | object | Compute tier and size of a server. |
sourceServerResourceId | string | Identifier of the server to be used as the source of the new server. Required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is returned only when the target server is a read replica. |
state | string | Possible states of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", "Updating", "Restarting", "Inaccessible", and "Provisioning". (Ready, Dropping, Disabled, Starting, Stopping, Stopped, Updating, Restarting, Inaccessible, Provisioning) |
storage | object | Storage properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major version of PostgreSQL database engine. Known values are: "18", "17", "16", "15", "14", "13", "12", and "11". (18, 17, 16, 15, 14, 13, 12, 11) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administratorLogin | string | Name of the login designated as the first password based administrator assigned to your instance of PostgreSQL. Must be specified the first time that you enable password based authentication on a server. Once set to a given value, it cannot be changed for the rest of the life of a server. If you disable password based authentication on a server which had it enabled, this password based role isn't deleted. |
administratorLoginPassword | string | Password assigned to the administrator login. As long as password authentication is enabled, this password can be changed at any time. |
authConfig | object | Authentication configuration properties of a server. |
availabilityZone | string | Availability zone of a server. |
backup | object | Backup properties of a server. |
cluster | object | Cluster properties of a server. |
createMode | string | Creation mode of a new server. Known values are: "Default", "Create", "Update", "PointInTimeRestore", "GeoRestore", "Replica", and "ReviveDropped". (Default, Create, Update, PointInTimeRestore, GeoRestore, Replica, ReviveDropped) |
dataEncryption | object | Data encryption properties of a server. |
fullyQualifiedDomainName | string | Fully qualified domain name of a server. |
highAvailability | object | High availability properties of a server. |
identity | object | User assigned managed identities assigned to the server. |
location | string | The geo-location where the resource lives. Required. |
maintenanceWindow | object | Maintenance window properties of a server. |
minorVersion | string | Minor version of PostgreSQL database engine. |
network | object | Network properties of a server. Only required if you want your server to be integrated into a virtual network provided by customer. |
pointInTimeUTC | string (date-time) | Creation time (in ISO8601 format) of the backup which you want to restore in the new server. It's required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'. |
privateEndpointConnections | array | List of private endpoint connections associated with the specified server. |
replica | object | Read replica properties of a server. Required only in case that you want to promote a server. |
replicaCapacity | integer | Maximum number of read replicas allowed for a server. |
replicationRole | string | Role of the server in a replication set. Known values are: "None", "Primary", "AsyncReplica", and "GeoAsyncReplica". (None, Primary, AsyncReplica, GeoAsyncReplica) |
sku | object | Compute tier and size of a server. |
sourceServerResourceId | string | Identifier of the server to be used as the source of the new server. Required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is returned only when the target server is a read replica. |
state | string | Possible states of a server. Known values are: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", "Updating", "Restarting", "Inaccessible", and "Provisioning". (Ready, Dropping, Disabled, Starting, Stopping, Stopped, Updating, Restarting, Inaccessible, Provisioning) |
storage | object | Storage properties of a server. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Major version of PostgreSQL database engine. Known values are: "18", "17", "16", "15", "14", "13", "12", and "11". (18, 17, 16, 15, 14, 13, 12, 11) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, server_name, subscription_id | Gets information about an existing server. | |
list_by_resource_group | select | resource_group_name, subscription_id | Lists all servers in a resource group. | |
list_by_subscription | select | subscription_id | Lists all servers in a subscription. | |
create_or_update | insert | resource_group_name, server_name, subscription_id, location | Creates a new server. | |
update | update | resource_group_name, server_name, subscription_id | Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition. | |
create_or_update | replace | resource_group_name, server_name, subscription_id, location | Creates a new server. | |
delete | delete | resource_group_name, server_name, subscription_id | Deletes or drops an existing server. | |
restart | exec | resource_group_name, server_name, subscription_id | Restarts PostgreSQL database engine in a server. | |
start | exec | resource_group_name, server_name, subscription_id | Starts a stopped server. | |
stop | exec | resource_group_name, server_name, subscription_id | Stops a server. | |
migrate_network_mode | exec | resource_group_name, server_name, subscription_id | Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model. | |
start_major_version_upgrade_precheck | exec | resource_group_name, server_name, subscription_id, targetVersion | Start Major Version Upgrade Prechecks. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- list_by_subscription
Gets information about an existing server.
SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
authConfig,
availabilityZone,
backup,
cluster,
createMode,
dataEncryption,
fullyQualifiedDomainName,
highAvailability,
identity,
location,
maintenanceWindow,
minorVersion,
network,
pointInTimeUTC,
privateEndpointConnections,
replica,
replicaCapacity,
replicationRole,
sku,
sourceServerResourceId,
state,
storage,
systemData,
tags,
type,
version
FROM azure.postgresql_flexible_servers.servers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all servers in a resource group.
SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
authConfig,
availabilityZone,
backup,
cluster,
createMode,
dataEncryption,
fullyQualifiedDomainName,
highAvailability,
identity,
location,
maintenanceWindow,
minorVersion,
network,
pointInTimeUTC,
privateEndpointConnections,
replica,
replicaCapacity,
replicationRole,
sku,
sourceServerResourceId,
state,
storage,
systemData,
tags,
type,
version
FROM azure.postgresql_flexible_servers.servers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all servers in a subscription.
SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
authConfig,
availabilityZone,
backup,
cluster,
createMode,
dataEncryption,
fullyQualifiedDomainName,
highAvailability,
identity,
location,
maintenanceWindow,
minorVersion,
network,
pointInTimeUTC,
privateEndpointConnections,
replica,
replicaCapacity,
replicationRole,
sku,
sourceServerResourceId,
state,
storage,
systemData,
tags,
type,
version
FROM azure.postgresql_flexible_servers.servers
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates a new server.
INSERT INTO azure.postgresql_flexible_servers.servers (
tags,
location,
properties,
sku,
identity,
resource_group_name,
server_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ sku }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: servers
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the servers resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the servers resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the servers resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Properties of a server.
value:
administratorLogin: "{{ administratorLogin }}"
administratorLoginPassword: "{{ administratorLoginPassword }}"
version: "{{ version }}"
minorVersion: "{{ minorVersion }}"
state: "{{ state }}"
fullyQualifiedDomainName: "{{ fullyQualifiedDomainName }}"
storage:
storageSizeGB: {{ storageSizeGB }}
autoGrow: "{{ autoGrow }}"
tier: "{{ tier }}"
iops: {{ iops }}
throughput: {{ throughput }}
type: "{{ type }}"
authConfig:
activeDirectoryAuth: "{{ activeDirectoryAuth }}"
passwordAuth: "{{ passwordAuth }}"
tenantId: "{{ tenantId }}"
dataEncryption:
primaryKeyURI: "{{ primaryKeyURI }}"
primaryUserAssignedIdentityId: "{{ primaryUserAssignedIdentityId }}"
geoBackupKeyURI: "{{ geoBackupKeyURI }}"
geoBackupUserAssignedIdentityId: "{{ geoBackupUserAssignedIdentityId }}"
type: "{{ type }}"
primaryEncryptionKeyStatus: "{{ primaryEncryptionKeyStatus }}"
geoBackupEncryptionKeyStatus: "{{ geoBackupEncryptionKeyStatus }}"
primaryFederatedIdentityClientId: "{{ primaryFederatedIdentityClientId }}"
geoBackupFederatedIdentityClientId: "{{ geoBackupFederatedIdentityClientId }}"
backup:
backupRetentionDays: {{ backupRetentionDays }}
geoRedundantBackup: "{{ geoRedundantBackup }}"
earliestRestoreDate: "{{ earliestRestoreDate }}"
network:
publicNetworkAccess: "{{ publicNetworkAccess }}"
delegatedSubnetResourceId: "{{ delegatedSubnetResourceId }}"
privateDnsZoneArmResourceId: "{{ privateDnsZoneArmResourceId }}"
highAvailability:
mode: "{{ mode }}"
state: "{{ state }}"
standbyAvailabilityZone: "{{ standbyAvailabilityZone }}"
maintenanceWindow:
customWindow: "{{ customWindow }}"
startHour: {{ startHour }}
startMinute: {{ startMinute }}
dayOfWeek: {{ dayOfWeek }}
sourceServerResourceId: "{{ sourceServerResourceId }}"
pointInTimeUTC: "{{ pointInTimeUTC }}"
availabilityZone: "{{ availabilityZone }}"
replicationRole: "{{ replicationRole }}"
replicaCapacity: {{ replicaCapacity }}
replica:
role: "{{ role }}"
capacity: {{ capacity }}
replicationState: "{{ replicationState }}"
promoteMode: "{{ promoteMode }}"
promoteOption: "{{ promoteOption }}"
createMode: "{{ createMode }}"
privateEndpointConnections:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
systemData:
createdBy: "{{ createdBy }}"
createdByType: "{{ createdByType }}"
createdAt: "{{ createdAt }}"
lastModifiedBy: "{{ lastModifiedBy }}"
lastModifiedByType: "{{ lastModifiedByType }}"
lastModifiedAt: "{{ lastModifiedAt }}"
properties:
groupIds:
- "{{ groupIds }}"
privateEndpoint:
id: "{{ id }}"
privateLinkServiceConnectionState:
status: "{{ status }}"
description: "{{ description }}"
actionsRequired: "{{ actionsRequired }}"
provisioningState: "{{ provisioningState }}"
cluster:
clusterSize: {{ clusterSize }}
defaultDatabaseName: "{{ defaultDatabaseName }}"
- name: sku
description: |
Compute tier and size of a server.
value:
name: "{{ name }}"
tier: "{{ tier }}"
- name: identity
description: |
User assigned managed identities assigned to the server.
value:
userAssignedIdentities: "{{ userAssignedIdentities }}"
principalId: "{{ principalId }}"
type: "{{ type }}"
tenantId: "{{ tenantId }}"
UPDATE examples
- update
Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
UPDATE azure.postgresql_flexible_servers.servers
SET
sku = '{{ sku }}',
identity = '{{ identity }}',
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Creates a new server.
REPLACE azure.postgresql_flexible_servers.servers
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
sku = '{{ sku }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type;
DELETE examples
- delete
Deletes or drops an existing server.
DELETE FROM azure.postgresql_flexible_servers.servers
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- restart
- start
- stop
- migrate_network_mode
- start_major_version_upgrade_precheck
Restarts PostgreSQL database engine in a server.
EXEC azure.postgresql_flexible_servers.servers.restart
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"restartWithFailover": {{ restartWithFailover }},
"failoverMode": "{{ failoverMode }}"
}'
;
Starts a stopped server.
EXEC azure.postgresql_flexible_servers.servers.start
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stops a server.
EXEC azure.postgresql_flexible_servers.servers.stop
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model.
EXEC azure.postgresql_flexible_servers.servers.migrate_network_mode
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Start Major Version Upgrade Prechecks.
EXEC azure.postgresql_flexible_servers.servers.start_major_version_upgrade_precheck
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetVersion": "{{ targetVersion }}"
}'
;