az sql db ltr-backup
Manage SQL database long term retention backups.
Commands
Name | Description | Type | Status |
---|---|---|---|
az sql db ltr-backup delete |
Delete a long term retention backup. |
Core | GA |
az sql db ltr-backup list |
List the long term retention backups for a location, server or database. |
Core | GA |
az sql db ltr-backup restore |
Restore a long term retention backup to a new database. |
Core | GA |
az sql db ltr-backup show |
Get a long term retention backup for a database. |
Core | GA |
az sql db ltr-backup wait |
Place the CLI in a waiting state until a condition of the database is met. |
Core | GA |
az sql db ltr-backup delete
Delete a long term retention backup.
az sql db ltr-backup delete --database
--location
--name
--server
[--yes]
Examples
Delete long term retention backup for database.
az sql db ltr-backup delete -l southeastasia -s myserver -d mydb -n "3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000"
Required Parameters
Name of the Azure SQL Database. If specified (along with server name), retrieves all requested backups under this database.
The location of the desired backups.
The name of the LTR backup. Use 'az sql db ltr-backup show' or 'az sql db ltr-backup list' for backup name.
Name of the Azure SQL Server. If specified, retrieves all requested backups under this server.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Do not prompt for confirmation.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az sql db ltr-backup list
List the long term retention backups for a location, server or database.
az sql db ltr-backup list --location
[--database]
[--database-state --state]
[--latest --only-latest-per-database]
[--resource-group]
[--server]
Examples
List long term retention backups for a database.
az sql db ltr-backup list -l southeastasia -s myserver -d mydb
List long term retention backups for a server (list only the latest LTR backups, which belong to live databases).
az sql db ltr-backup list -l southeastasia -s myserver --database-state Live --only-latest-per-database True
List long term retention backups for a server (with resource group argument).
az sql db ltr-backup list -l southeastasia -g mygroup -s myserver
List long term retention backups for a location (list only the latest LTR backups, which belong to live databases).
az sql db ltr-backup list -l southeastasia --database-state Live --only-latest-per-database True
List long term retention backups for a location (with resource group argument).
az sql db ltr-backup list -l southeastasia -g mygroup
Required Parameters
The location of the desired backups.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Name of the Azure SQL Database. If specified (along with server name), retrieves all requested backups under this database.
'All', 'Live', or 'Deleted'. Will fetch backups only from databases of specified state. If no state provied, defaults to 'All'.
If true, will only return the latest backup for each database.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Azure SQL Server. If specified, retrieves all requested backups under this server.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az sql db ltr-backup restore
Restore a long term retention backup to a new database.
az sql db ltr-backup restore --backup-id
--dest-database
--dest-resource-group
--dest-server
[--assign-identity {false, true}]
[--auto-pause-delay]
[--availability-zone]
[--backup-storage-redundancy --bsr]
[--capacity]
[--compute-model {Provisioned, Serverless}]
[--edition --tier]
[--elastic-pool]
[--encryption-protector]
[--encryption-protector-auto-rotation --epauto {false, true}]
[--family]
[--federated-client-id]
[--ha-replicas --read-replicas]
[--keys]
[--license-type {BasePrice, LicenseIncluded}]
[--min-capacity]
[--no-wait]
[--preferred-enclave-type {Default, VBS}]
[--read-scale {Disabled, Enabled}]
[--service-level-objective --service-objective]
[--tags]
[--umi --user-assigned-identity-id]
[--zone-redundant {false, true}]
Examples
Restore LTR backup.
az sql db ltr-backup restore \
--dest-database targetdb --dest-server myserver --dest-resource-group mygroup \
--backup-id "/subscriptions/6caa113c-794c-42f8-ab9d-878d8aa104dc/resourceGroups/mygroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionServers/myserver/longTermRetentionDatabases/sourcedb/longTermRetentionBackups/3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000"
Required Parameters
The resource id of the long term retention backup to be restored. Use 'az sql db ltr-backup show' or 'az sql db ltr-backup list' for backup id.
Name of the database that will be created as the restore destination.
Name of the resource group of the server to restore database to.
Name of the server to restore 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.
Assign identity for database.
Property | Value |
---|---|
Accepted values: | false, true |
Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.
Property | Value |
---|---|
Parameter group: | Serverless offering Arguments |
Availability zone.
Backup storage redundancy used to store backups. Allowed values include: Local, Zone, Geo, GeoZone.
The capacity component of the sku in integer number of DTUs or vcores.
Property | Value |
---|---|
Parameter group: | Performance Level (components) Arguments |
The compute model of the database.
Property | Value |
---|---|
Parameter group: | Serverless offering Arguments |
Accepted values: | Provisioned, Serverless |
The edition component of the sku. Allowed values include: Basic, Standard, Premium, GeneralPurpose, BusinessCritical, Hyperscale.
Property | Value |
---|---|
Parameter group: | Performance Level (components) Arguments |
The name or resource id of the elastic pool to create the database in.
Property | Value |
---|---|
Parameter group: | Performance Level Arguments |
Specifies the Azure key vault key to be used as database encryption protector key.
Specifies the database encryption protector key auto rotation flag. Can be either true, false or null.
Property | Value |
---|---|
Accepted values: | false, true |
The compute generation component of the sku (for vcore skus only). Allowed values include: Gen4, Gen5.
Property | Value |
---|---|
Parameter group: | Performance Level (components) Arguments |
The federated client id for the SQL Database. It is used for cross tenant CMK scenario.
The number of high availability replicas to provision for the database. Only settable for Hyperscale edition.
The list of AKV keys for the SQL Database.
The license type to apply for this database.LicenseIncluded
if you need a license, or BasePrice
if you have a license and are eligible for the Azure HybridBenefit.
Property | Value |
---|---|
Accepted values: | BasePrice, LicenseIncluded |
Minimal capacity that database will always have allocated, if not paused.
Property | Value |
---|---|
Parameter group: | Serverless offering Arguments |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Default value: | False |
Specifies type of enclave for this resource.
Property | Value |
---|---|
Accepted values: | Default, VBS |
If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
Property | Value |
---|---|
Accepted values: | Disabled, Enabled |
The service objective for the new database. For example: Basic, S0, P1, GP_Gen4_1, GP_S_Gen5_8, BC_Gen5_2, HS_Gen5_32.
Property | Value |
---|---|
Parameter group: | Performance Level Arguments |
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
The list of user assigned identity for the SQL Database.
Specifies whether to enable zone redundancy. Default is true if no value is specified.
Property | Value |
---|---|
Accepted values: | false, true |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az sql db ltr-backup show
Get a long term retention backup for a database.
az sql db ltr-backup show --database
--location
--name
--server
Examples
Show long term retention backup for a database.
az sql db ltr-backup show -l southeastasia -s myserver -d mydb -n "3214b3fb-fba9-43e7-96a3-09e35ffcb336;132292152080000000;Hot"
Required Parameters
Name of the Azure SQL Database. If specified (along with server name), retrieves all requested backups under this database.
The location of the desired backups.
The name of the LTR backup. Use 'az sql db ltr-backup show' or 'az sql db ltr-backup list' for backup name.
Name of the Azure SQL Server. If specified, retrieves all requested backups under this server.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az sql db ltr-backup wait
Place the CLI in a waiting state until a condition of the database is met.
az sql db ltr-backup wait [--created]
[--custom]
[--deleted]
[--exists]
[--expand]
[--filter]
[--ids]
[--interval]
[--name]
[--resource-group]
[--server]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Wait until created with 'provisioningState' at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
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 |
Wait until deleted.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Wait until the resource exists.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
The child resources to include in the response. Default value is None.
An OData filter expression that filters elements in the collection. Default value is None.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Polling interval in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 30 |
Name of the Azure SQL Database.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Maximum wait in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 3600 |
Wait until updated with provisioningState at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |