Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy

Gets a backup short term retention policy.

Syntax

Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy
   [-ResourceGroupName] <String>
   [-InstanceName] <String>
   [-DatabaseName] <String>
   [-DeletionDate <DateTime>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy
   -InputObject <AzureSqlManagedDatabaseBaseModel>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy
   -ResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy cmdlet gets the short term retention policy registered to this database. The policy is the retention period, in days, for point-in-time restore backups.

Examples

Example 1

Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy -ResourceGroupName resourcegroup01 -InstanceName instance01 -DatabaseName database01

ResourceGroupName : resourcegroup01
InstanceName      : instance01
DatabaseName      : database01
DeletionDate      :
RetentionDays     : 7

This command gets the short term retention policy for database01.

Example 2

Get-AzSqlInstanceDatabase -ResourceGroupName resourcegroup01 -InstanceName instance01 -Name database01 | Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy

ResourceGroupName : resourcegroup01
InstanceName      : instance01
DatabaseName      : database01
DeletionDate      :
RetentionDays     : 7

This command gets the short term retention policy for database01 via piping in a database object.

Example 3

Get-AzSqlDeletedInstanceDatabaseBackup -ResourceGroupName "ContosoResourceGroup" -InstanceName "ContosoServer" -DatabaseName "DB1" | Get-AzSqlInstanceDatabaseBackupShortTermRetentionPolicy

ResourceGroupName : resourcegroup01
InstanceName      : instance01
DatabaseName      : database01
DeletionDate      : 2019-03-03 12:00:17 AM
RetentionDays     : 7

ResourceGroupName : resourcegroup01
InstanceName      : instance01
DatabaseName      : database01
DeletionDate      : 2019-03-02 11:00:16 PM
RetentionDays     : 7

This command gets the short term retention policy for all deleted databases named database01 via piping in a deleted database object.

Parameters

-DatabaseName

The name of the Azure SQL Instance Database to retrieve backups for.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeletionDate

The deletion date of the Azure SQL Instance Database to retrieve backups for, with millisecond precision (e.g. 2016-02-23T00:21:22.847Z)

Type:Nullable<T>[DateTime]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

The live or deleted database object to get/set the policy for.

Type:AzureSqlManagedDatabaseBaseModel
Aliases:AzureSqlInstanceDatabase, AzureInstanceDatabaseObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-InstanceName

The name of the Azure SQL Managed Instance the database is in.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The short term retention policy resource Id.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

AzureSqlManagedDatabaseBaseModel

String

Outputs

AzureSqlManagedDatabaseBackupShortTermRetentionPolicyModel