Share via


az sql midb ltr-backup

Manage SQL Managed Instance database long term retention backups.

Commands

Name Description Type Status
az sql midb ltr-backup delete

Delete a long term retention backup.

Core Preview
az sql midb ltr-backup list

List the long term retention backups for a location, instance or database.

Core Preview
az sql midb ltr-backup restore

Restore a long term retention backup to a new database.

Core Preview
az sql midb ltr-backup show

Get a long term retention backup for a managed database.

Core Preview
az sql midb ltr-backup wait

Place the CLI in a waiting state until a condition of the managed database is met.

Core GA

az sql midb ltr-backup delete

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a long term retention backup.

az sql midb ltr-backup delete [--backup-id --id]
                              [--database]
                              [--location]
                              [--managed-instance --mi]
                              [--name]
                              [--yes]

Examples

Delete long term retention backup for a managed database.

az sql midb ltr-backup delete -l southeastasia --mi myinstance -d mymanageddb --name "3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000"

Delete long term retention backup for a managed database.

az sql midb ltr-backup delete --backup-id '/subscriptions/6caa113c-794c-42f8-ab9d-878d8aa104dc/resourceGroups/mygroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionManagedInstances/myinstance/longTermRetentionDatabases/mymanageddb/longTermRetentionManagedInstanceBackups/3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000'

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--backup-id --id

The resource id of the backups. Use 'az sql midb ltr-backup show' or 'az sql midb ltr-backup list' for backup id. If provided, other arguments are not required.

--database -d

The name of the Azure SQL Managed Database.

--location -l

The location of the desired backup(s).

--managed-instance --mi

Name of the Azure SQL Managed Instance.

--name -n

The name of the LTR backup. Use 'az sql midb ltr-backup show' or 'az sql midb ltr-backup list' for backup name.

--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az sql midb ltr-backup list

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List the long term retention backups for a location, instance or database.

az sql midb ltr-backup list --location
                            [--database]
                            [--database-state --state]
                            [--latest --only-latest-per-database]
                            [--managed-instance --mi]
                            [--resource-group]

Examples

List long term retention backups for a managed database.

az sql midb ltr-backup list -l southeastasia --mi myinstance -d mymanageddb

List long term retention backups for a managed instance (list only the latest LTR backups, which belong to live databases).

az sql midb ltr-backup list -l southeastasia --mi myinstance --database-state Live --only-latest-per-database

List long term retention backups for a managed instance (with resource group argument).

az sql midb ltr-backup list -l southeastasia -g mygroup --mi myinstance

List long term retention backups for a location (list only the latest LTR backups, which belong to live databases).

az sql midb ltr-backup list -l southeastasia --database-state Live --only-latest-per-database

List long term retention backups for a location (with resource group argument).

az sql midb ltr-backup list -l southeastasia -g mygroup

Required Parameters

--location -l

The location of the desired backup(s).

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--database -d

The name of the Azure SQL Managed Database. If specified (along with instance name), retrieves all requested backups under this database.

--database-state --state

'All', 'Live', or 'Deleted'. Will fetch backups only from databases of specified state. If no state provied, defaults to 'All'.

--latest --only-latest-per-database

If true, will only return the latest backup for each database.

--managed-instance --mi

Name of the Azure SQL Managed Instance. If specified, retrieves all requested backups under this managed instance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az sql midb ltr-backup restore

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Restore a long term retention backup to a new database.

az sql midb ltr-backup restore --backup-id --id
                               --dest-database
                               --dest-mi
                               --dest-resource-group
                               [--no-wait]

Examples

Restore a managed database using LTR backup.

az sql midb ltr-backup restore \
    --dest-database targetmidb --dest-mi myinstance --dest-resource-group mygroup \
    --backup-id "/subscriptions/6caa113c-794c-42f8-ab9d-878d8aa104dc/resourceGroups/mygroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionManagedInstances/myinstance/longTermRetentionDatabases/sourcemidb/longTermRetentionManagedInstanceBackups/3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000"

Required Parameters

--backup-id --id

The resource id of the long term retention backup to be restored. Use 'az sql midb ltr-backup show' or 'az sql midb ltr-backup list' for backup id.

--dest-database

Name of the managed database that will be created as the restore destination.

--dest-mi

Name of the managed instance to restore managed database to.

--dest-resource-group

Name of the resource group of the managed instance to restore managed database to.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az sql midb ltr-backup show

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get a long term retention backup for a managed database.

az sql midb ltr-backup show [--backup-id --id]
                            [--database]
                            [--location]
                            [--managed-instance --mi]
                            [--name]

Examples

Show long term retention backup for a managed database.

az sql midb ltr-backup show --backup-id '/subscriptions/6caa113c-794c-42f8-ab9d-878d8aa104dc/resourceGroups/mygroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionManagedInstances/myinstance/longTermRetentionDatabases/mymanageddb/longTermRetentionManagedInstanceBackups/3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000'

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--backup-id --id

The resource id of the backups. Use 'az sql midb ltr-backup show' or 'az sql midb ltr-backup list' for backup id. If provided, other arguments are not required.

--database -d

The name of the Azure SQL Managed Database.

--location -l

The location of the desired backup(s).

--managed-instance --mi

Name of the Azure SQL Managed Instance.

--name -n

The name of the LTR backup. Use 'az sql midb ltr-backup show' or 'az sql midb ltr-backup list' for backup name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az sql midb ltr-backup wait

Place the CLI in a waiting state until a condition of the managed database is met.

az sql midb ltr-backup wait --database
                            --managed-instance --mi
                            --resource-group
                            [--created]
                            [--custom]
                            [--deleted]
                            [--exists]
                            [--interval]
                            [--timeout]
                            [--updated]

Required Parameters

--database -d

The name of the Azure SQL Managed Database.

--managed-instance --mi

Name of the Azure SQL Managed Instance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 30
--timeout

Maximum wait in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False