Get-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy
Gets a managed database's long term retention policy
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Get-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy
[-InstanceName] <String>
[-DatabaseName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Get-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy cmdlet gets the long term retention policy registered to this managed database. The policy is an Azure Backup resource used to define backup storage policy.
Examples
Example 1
PS C:\> Get-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy -ResourceGroupName testResourceGroup -InstanceName testInstance -DatabaseName test
ResourceGroupName : testResourceGroup
ManagedInstanceName : testInstance
DatabaseName : test
WeeklyRetention : P2W
MonthlyRetention : PT0S
YearlyRetention : PT0S
WeekOfYear : 0
Location :
Gets the current version of the long term retention policy for the database
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the Azure Managed Database to use.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the Azure Managed Instance the database belongs to.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
AzureSqlManagedDatabaseBackupLongTermRetentionPolicyModel