Get-AzSqlDatabaseBackupShortTermRetentionPolicy

Gets a backup short term retention policy.

Syntax

Get-AzSqlDatabaseBackupShortTermRetentionPolicy
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-DatabaseName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlDatabaseBackupShortTermRetentionPolicy
   -AzureSqlDatabaseObject <AzureSqlDatabaseModel>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlDatabaseBackupShortTermRetentionPolicy
   -ResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzSqlDatabaseBackupShortTermRetentionPolicy 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

PS C:\> Get-AzSqlDatabaseBackupShortTermRetentionPolicy -ResourceGroupName resourcegroup01 -ServerName server01 -DatabaseName database01

ResourceGroupName ServerName  DatabaseName RetentionDays
----------------- ----------  ------------ -------------
resourcegroup01   server01    database01   35

This command gets the short term retention policy for database01.

Example 2

PS C:\> Get-AzSqlDatabase -ResourceGroupName resourcegroup01 -ServerName server01 -DatabaseName database01 | Get-AzSqlDatabaseBackupShortTermRetentionPolicy

ResourceGroupName ServerName  DatabaseName RetentionDays
----------------- ----------  ------------ -------------
resourcegroup01   server01    database01   35

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

Parameters

-AzureSqlDatabaseObject

The database object to get the policy for.

Type:AzureSqlDatabaseModel
Aliases:AzureSqlDatabase
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-DatabaseName

The name of the Azure SQL Database to use.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceId

The short term retention policy resource Id.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServerName

The name of the Azure SQL Server the database is in.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Inputs

AzureSqlDatabaseModel

String

Outputs

Microsoft.Azure.Commands.Sql.Backup.Model.AzureSqlDatabaseBackupShortTermRetentionPolicyModel