Servers - Restart
Restarts PostgreSQL database engine in a server.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/restart?api-version=2025-08-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 minLength: 3maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)* |
The name of the server. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| failoverMode |
Failover mode. |
|
| restartWithFailover |
boolean |
Indicates if restart the PostgreSQL database engine should failover or switch over from primary to standby. This only works if server has high availability enabled. |
Responses
| Name | Type | Description |
|---|---|---|
| 202 Accepted |
Accepted. Headers
|
|
| Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Microsoft Entra 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
| Restart PostgreSQL database engine in a server with a forced failover to standby server. |
| Restart PostgreSQL database engine in a server. |
Restart PostgreSQL database engine in a server with a forced failover to standby server.
Sample request
POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/restart?api-version=2025-08-01
{
"restartWithFailover": true,
"failoverMode": "ForcedFailover"
}
Sample response
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Restart PostgreSQL database engine in a server.
Sample request
POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/restart?api-version=2025-08-01
Sample response
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Definitions
| Name | Description |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Failover |
Failover mode. |
|
Restart |
PostgreSQL database engine restart parameters. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| 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. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
FailoverMode
Failover mode.
| Value | Description |
|---|---|
| PlannedFailover |
Triggers a failover from primary to standby without killing the primary database process first. This is a graceful failover that attempts to preserve data consistency. |
| ForcedFailover |
Kills the primary database process first, then triggers the failover. This is more aggressive and used when the primary is unresponsive or in an unhealthy state. |
| PlannedSwitchover |
Similar to 'PlannedFailover' but prefers a switch over operation where roles are swapped between primary and standby. |
| ForcedSwitchover |
Kills the primary database process and then triggers a switch over with role swapping. |
RestartParameter
PostgreSQL database engine restart parameters.
| Name | Type | Description |
|---|---|---|
| failoverMode |
Failover mode. |
|
| restartWithFailover |
boolean |
Indicates if restart the PostgreSQL database engine should failover or switch over from primary to standby. This only works if server has high availability enabled. |