Share via


Backups Long Term Retention - Start

Initiates a long term retention backup.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup?api-version=2025-08-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

serverName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

The name of the server.

subscriptionId
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
backupSettings True

BackupSettings

Backup Settings

targetDetails True

BackupStoreDetails

Backup store detail for target server

Responses

Name Type Description
200 OK

BackupsLongTermRetentionResponse

OK.

Headers

x-ms-request-id: string

202 Accepted

Accepted.

Headers

  • Retry-After: integer
  • x-ms-request-id: string
  • Location: string
  • Azure-AsyncOperation: string
Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Headers

  • x-ms-error-code: string
  • x-ms-request-id: string

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

Initiate a long term retention backup.

Sample request

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/startLtrBackup?api-version=2025-08-01

{
  "backupSettings": {
    "backupName": "exampleltrbackup"
  },
  "targetDetails": {
    "sasUriList": [
      "sasuri"
    ]
  }
}

Sample response

{
  "properties": {
    "datasourceSizeInBytes": 23,
    "dataTransferredInBytes": 23,
    "backupMetadata": "backupmetadata",
    "status": "Running",
    "startTime": "2025-06-01T18:30:22.123Z",
    "endTime": "2025-06-01T18:35:22.123Z",
    "percentComplete": 100
  }
}
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/westcentralus/operationResults/ffc80e91-03db-4534-b5de-bacb77aa6a81?api-version=2025-06-01-preview
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/westcentralus/azureAsyncOperation/ffc80e91-03db-4534-b5de-bacb77aa6a81?api-version=2025-06-01-preview

Definitions

Name Description
BackupSettings

The settings for the long term backup.

BackupsLongTermRetentionRequest

The request that is made for a long term retention backup.

BackupsLongTermRetentionResponse

Response for the LTR backup API call

BackupStoreDetails

Details about the target where the backup content will be stored.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ExecutionStatus

Service-set extensible enum indicating the status of operation

BackupSettings

The settings for the long term backup.

Name Type Description
backupName

string

Backup Name for the current backup

BackupsLongTermRetentionRequest

The request that is made for a long term retention backup.

Name Type Description
backupSettings

BackupSettings

Backup Settings

targetDetails

BackupStoreDetails

Backup store detail for target server

BackupsLongTermRetentionResponse

Response for the LTR backup API call

Name Type Description
properties.backupMetadata

string

Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery point. e.g. Versions, DataFormat etc

properties.backupName

string

Name of Backup operation

properties.dataTransferredInBytes

integer (int64)

Data transferred in bytes

properties.datasourceSizeInBytes

integer (int64)

Size of datasource in bytes

properties.endTime

string (date-time)

End time of the operation.

properties.errorCode

string

The error code.

properties.errorMessage

string

The error message.

properties.percentComplete

number (double)

minimum: 0
maximum: 100

PercentageCompleted

properties.startTime

string (date-time)

Start time of the operation.

properties.status

ExecutionStatus

Service-set extensible enum indicating the status of operation

BackupStoreDetails

Details about the target where the backup content will be stored.

Name Type Description
sasUriList

string[]

List of SAS uri of storage containers where backup data is to be streamed/copied.

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ExecutionStatus

Service-set extensible enum indicating the status of operation

Value Description
Running

The operation is currently running.

Cancelled

The operation was cancelled.

Failed

The operation failed.

Succeeded

The operation succeeded.