DB Agent - Create Or Update
Enables or disables the database agent for a flexible server.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/dbAgents/Default?api-version=2026-07-01-preview
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 | Required | Type | Description |
|---|---|---|---|
| properties | True |
The requested database agent properties. |
Responses
| Name | Type | Description |
|---|---|---|
| 202 Accepted |
The response returned when a database agent write is accepted. Headers
|
|
| Other Status Codes |
An unexpected error response. |
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
| Disable the singleton Default database agent for a server. |
| Enable the singleton Default database agent for a server. |
Disable the singleton Default database agent for a server.
Sample request
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/dbAgents/Default?api-version=2026-07-01-preview
{
"properties": {
"state": "Disabled"
}
}
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=2026-07-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=2026-07-01-preview
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/dbAgents/Default",
"name": "Default",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/dbAgents",
"properties": {
"state": "Disabling",
"provisioningState": "InProgress",
"lastModifiedTime": "2026-08-28T15:30:00Z"
}
}
Enable the singleton Default database agent for a server.
Sample request
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/dbAgents/Default?api-version=2026-07-01-preview
{
"properties": {
"state": "Enabled"
}
}
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=2026-07-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=2026-07-01-preview
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/dbAgents/Default",
"name": "Default",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/dbAgents",
"properties": {
"state": "Enabling",
"provisioningState": "InProgress",
"lastModifiedTime": "2026-08-28T15:30:00Z"
}
}
Definitions
| Name | Description |
|---|---|
|
created |
The type of identity that created the resource. |
|
Db |
The database agent configuration for a PostgreSQL flexible server. |
|
Db |
A request to enable or disable the database agent. |
|
Db |
Writable properties of the database agent configuration. |
|
Db |
The database agent states accepted in a write request. |
|
Db |
Properties of the database agent configuration. |
|
Db |
The provisioning state of the database agent resource. |
|
Db |
The state of the database agent. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
system |
Metadata pertaining to creation and last modification of the resource. |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DbAgent
The database agent configuration for a PostgreSQL flexible server.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| name |
string |
The name of the resource |
| properties |
The resource-specific properties for this resource. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
DbAgentForUpdate
A request to enable or disable the database agent.
| Name | Type | Description |
|---|---|---|
| properties |
The requested database agent properties. |
DbAgentForUpdateProperties
Writable properties of the database agent configuration.
| Name | Type | Description |
|---|---|---|
| state |
The requested state of the database agent. |
DbAgentForUpdateState
The database agent states accepted in a write request.
| Value | Description |
|---|---|
| Enabled |
Enable the database agent. |
| Disabled |
Disable the database agent. |
DbAgentProperties
Properties of the database agent configuration.
| Name | Type | Description |
|---|---|---|
| lastModifiedTime |
string (date-time) |
The time when the database agent configuration was last modified. |
| provisioningState |
The provisioning state of the database agent resource. |
|
| state |
The state of the database agent. |
DbAgentProvisioningState
The provisioning state of the database agent resource.
| Value | Description |
|---|---|
| Succeeded |
Resource has been created. |
| Failed |
Resource creation failed. |
| Canceled |
Resource creation was canceled. |
| InProgress |
The database agent lifecycle operation is in progress. |
DbAgentState
The state of the database agent.
| Value | Description |
|---|---|
| Enabling |
The database agent is being enabled. |
| Enabled |
The database agent is enabled. |
| Disabling |
The database agent is being disabled. |
| Disabled |
The database agent is disabled. |
| Failed |
The database agent lifecycle operation failed. |
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. |
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. |