< Back

New-AzureRmVMSqlServerAutoBackupConfig

Tue Jan 29, 2019 9:38 pm

NAME New-AzureRmVMSqlServerAutoBackupConfig



SYNOPSIS

Creates a configuration object for SQL Server automatic backup.





SYNTAX

New-AzureRmVMSqlServerAutoBackupConfig [-ResourceGroupName] <String> [[-Enable]] [[-RetentionPeriodInDays] <Int32>] [[-EnableEncryption]]

[[-CertificatePassword] <SecureString>] [[-StorageUri] <Uri>] [[-StorageContext] <IStorageContext>] [[-StorageKey] <SecureString>]

[-BackupScheduleType {Manual | Automated}] [-BackupSystemDbs] [-DefaultProfile <IAzureContextContainer>] [-FullBackupFrequency {Daily | Weekly}]

[-FullBackupStartHour <Int32>] [-FullBackupWindowInHours <Int32>] [-LogBackupFrequencyInMinutes <Int32>] [<CommonParameters>]





DESCRIPTION

The New-AzureRmVMSqlServerAutoBackupConfig cmdlet creates a configuration object for SQL Server automatic backup.





PARAMETERS

-BackupScheduleType <String>

Backup schedule type, manual or automated



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-BackupSystemDbs [<SwitchParameter>]

Backup system databases



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-CertificatePassword <SecureString>

Specifies a password to encrypt the certificate that is used to perform SQL Server encrypted backups.



Required? false

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Enable [<SwitchParameter>]

Indicates that automated backup for the SQL Server virtual machine is enabled. If you specify this parameter, automated backup sets a backup

schedule for all current and new databases. This updates your Managed Backup settings to follow this schedule.



Required? false

Position? 1

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-EnableEncryption [<SwitchParameter>]

Indicates that this cmdlet enables encryption.



Required? false

Position? 3

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FullBackupFrequency <String>

Sql Server Full Backup frequency, daily or weekly



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FullBackupStartHour <Int32>

Hour of the day (0-23) when the Sql Server Full Backup should start



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FullBackupWindowInHours <Int32>

Sql Server Full Backup window in hours



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LogBackupFrequencyInMinutes <Int32>

Sql Server Log Backup frequency, once every 1-60 minutes



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group of the virtual machine.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RetentionPeriodInDays <Int32>

Specifies the number of days to retain a backup.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageContext <IStorageContext>

Specifies the storage account that will be used to store backups. To obtain an AzureStorageContext object, use the New-AzureStorageContext

cmdlet. The default is the storage account that is associated with the SQL Server virtual machine.



Required? false

Position? 5

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageKey <SecureString>

Specifies the storage key of the blob storage account.



Required? false

Position? 5

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageUri <Uri>

Specifies the Uniform Resource Identifier (URI) of the blob storage account.



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Compute.AutoBackupSettings







NOTES









Example 1: Create an automatic backup configuration using storage URI and account key



PS C:\\> $AutoBackupConfig = New-AzureRmVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri "\\\\contoso\\StorageGeneral" -StorageKey

"< Storage Key for ContosoGeneral >"

Enable : True

EnableEncryption : False

RetentionPeriodInDays : 10



This command creates an automatic backup configuration object by specifying storage URI and account key. Automatic backup is enabled and automatic

backups are kept for 10 days. The command stores the result in the $AutoBackupConfig variable. You can specify this configuration item for other

cmdlets, such as the Set-AzureRmVMSqlServerExtension cmdlet.





Example 2: Create an automatic backup configuration using storage context



PS C:\\> $StorageContext = New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral >"

PS C:\\> $AutoBackupConfig = New-AzureRmVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10

Enable : True

EnableEncryption : False

RetentionPeriodInDays : 10



The first command creates a storage context, and then stores it in the $StorageContext variable. For more information, see New-AzureStorageContext.



The second command creates an automatic backup configuration object by specifying the storage context in $StorageContext. Automatic backup is

enabled and automatic backups are kept for 10 days.





Example 3: Create an automatic backup configuration using storage context with encryption and password



PS C:\\> $StorageContext = New-AzureRmVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10 -EnableEncryption

-CertificatePassword $CertificatePassword

Enable : True

EnableEncryption : True

RetentionPeriodInDays : 10



This command creates and stores an automatic backup configuration object. The command specifies the storage context created in a previous example.

The command enables encryption with password. The password was previously stored as a secure string in the $CertificatePassword variable. To

create a secure string, use the ConvertTo-SecureString cmdlet.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ckupconfig

New-AzureVMSqlServerAutoPatchingConfig

Set-AzureRmVMSqlServerExtension