Share via


Backup And Export - Create

Exports the backup of the given server by creating a backup if not existing.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport?api-version=2023-10-01-preview

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

pattern: ^[a-z0-9][-a-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 Target Store Details

Responses

Name Type Description
200 OK

BackupAndExportResponse

OK

202 Accepted

Accepted

Headers

  • Location: string
  • Azure-AsyncOperation: string
Other Status Codes

ErrorResponse

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 and Export Backup

Sample request

POST https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupAndExport?api-version=2023-10-01-preview

{
  "targetDetails": {
    "objectType": "FullBackupStoreDetails",
    "sasUriList": [
      "sasuri1",
      "sasuri2"
    ]
  },
  "backupSettings": {
    "backupName": "customer-backup-name"
  }
}

Sample response

{
  "id": "/subscriptions/cb9d743d-2140-4e73-b871-cd31abab1d2f/resourceGroups/mrgsumitkumatest1/providers/Microsoft.DBforMySQL/flexibleServers/servermysql-01/backupAndExport/custom-backup101",
  "name": "custom-backup101",
  "type": "Microsoft.DBforMySQL/flexibleServers/backupAndExport",
  "status": "Failed",
  "startTime": "2022-12-29T07:34:02.328326Z",
  "endTime": "2022-12-29T07:37:05.6406008Z",
  "percentComplete": 100,
  "properties": {
    "datasourceSizeInBytes": 1024,
    "dataTransferredInBytes": 1024,
    "backupMetadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}"
  },
  "error": {
    "code": "AggregateException",
    "message": "System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"
  }
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforMySQL/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2023-06-01-preview
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforMySQL/locations/eastus/azureAsyncOperation/00000000-0000-0000-0000-000000000000?api-version=2023-06-01-preview

Definitions

Name Description
BackupAndExportRequest

BackupAndExport API Request

BackupAndExportResponse

Represents BackupAndExport API Response

BackupFormat

Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE)

BackupSettings

Backup Settings

createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

OperationStatus

The operation status

systemData

Metadata pertaining to creation and last modification of the resource.

BackupAndExportRequest

BackupAndExport API Request

Name Type Description
backupSettings

BackupSettings

Backup Settings

targetDetails

BackupStoreDetails

Backup Target Store Details

BackupAndExportResponse

Represents BackupAndExport API Response

Name Type Description
endTime

string (date-time)

End time

error

ErrorDetail

The error object.

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

percentComplete

number (double)

minimum: 0
maximum: 100

Operation progress (0-100).

properties.backupMetadata

string

Metadata related to backup to be stored for restoring resource in key-value pairs.

properties.dataTransferredInBytes

integer (int64)

Data transferred in bytes

properties.datasourceSizeInBytes

integer (int64)

Size of datasource in bytes

startTime

string (date-time)

Start time

status

OperationStatus

The operation status

systemData

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"

BackupFormat

Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE)

Value Description
CollatedFormat
Raw

BackupSettings

Backup Settings

Name Type Description
backupFormat

BackupFormat

Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE)

backupName

string

pattern: (^[a-z0-9]$)|(^[a-z0-9][a-z0-9-]*[a-z0-9]$)

The name of the backup.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

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.

OperationStatus

The operation status

Value Description
Pending

The operation has been accepted but hasn't started.

InProgress

The operation is running

Succeeded

The operation Succeeded

Failed

The operation Failed

CancelInProgress

The cancellation in progress

Canceled

The operation has been Canceled

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

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

createdByType

The type of identity that last modified the resource.