< Back

New-AzureVMSqlServerAutoBackupConfig

Wed Jan 30, 2019 5:49 pm

NAME New-AzureVMSqlServerAutoBackupConfig



SYNOPSIS

Creates a configuration object for SQL Server automatic backup.





SYNTAX

New-AzureVMSqlServerAutoBackupConfig [[-Enable]] [[-RetentionPeriodInDays] <Int32>] [[-EnableEncryption]] [[-CertificatePassword] <SecureString>]

[[-StorageUri] <Uri>] [[-StorageContext] <AzureStorageContext>] [[-StorageKey] <SecureString>] [-Profile <AzureSMProfile>] [-InformationAction

<ActionPreference>] [-InformationVariable <String>] [-BackupScheduleType <String>] [-BackupSystemDbs] [-FullBackupFrequency <String>]

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





DESCRIPTION

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





PARAMETERS

-Enable [<SwitchParameter>]

Indicates that automated backup for the SQL Server virtual machine is enabled. If you use 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? 0

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RetentionPeriodInDays <Int32>





Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-EnableEncryption [<SwitchParameter>]





Required? false

Position? 2

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? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageUri <Uri>

Specifies a URI to the blob storage account.



Required? false

Position? 4

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



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageContext <AzureStorageContext>

Specifies the storage account to be used to store backups. Default is the storage account associated with the SQL Server virtual machine.



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-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



-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



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

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

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



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Create an autobackup configuration using storage URI and account key --------------------------



PS C:\\>$ABS = New-AzureVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri $StorageUrl -StorageKey $StorageAccountKeySecure

Enable : True

EnableEncryption : False

RetentionPeriodInDays : 10



This command creates an auto-backup configuration object by specifying storage URL and account key.

-------------------------- Example 2: Create an autobackup configuration using storage context --------------------------



PS C:\\>$ABS = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10

Enable : True

EnableEncryption : False

RetentionPeriodInDays : 10



This command creates an auto-backup configuration object by specifying storage context.

-------------------------- Example 3: Create an autobackup configuration using storage context with encryption and password --------------------------



PS C:\\>$ABS = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10 -EnableEncryption -CertificatePassword

$CertPasswd

Enable : True

EnableEncryption : True

RetentionPeriodInDays : 10



This command creates an auto-backup configuration object by specifying Storage context and enabling encryption option with password. The

certificatepassword ist stored in the variable named $CertPasswd.

-------------------------- Example 4: Create an automatic backup configuration with manual backup schedule --------------------------



$storageUrl = 'https://stocrptestps9662.blob.core.windows.net/'

$storageKey = ConvertTo-SecureString -String CDbJ5eqkPiR+mfmlHFRMVNtLyUMNn8asHs3ulyFeSUyibyg0JCofVh5/8hX4qE8GHoHtnQmIeAzwBTHC2hlvg== -AsPlainText -Force

$backupConfig=New-AzureVMSqlServerAutoBackupConfig -Enable -ResourceGroupName crptestps9662 -BackupSystemDbs -BackupScheduleType Manual

-FullBackupFrequency Daily -FullBackupStartHour 10 -FullBackupWindowInHours 10 -LogBackupFrequencyInMinutes 10 -RetentionPeriodInDays 10 -StorageUri

$storageUrl -StorageKey $storageKey



This command creates and stores an automatic backup configuration object. The command specifies manual backup schedule with associated settings like

FullBackupFrequency, FullBackupStartHour, FullBackupWindowInHours and LogBackupFrequencyInMinutes.



Enable : True EnableEncryption : False RetentionPeriod : 10 StorageUrl :

https://stocrptestps9662.blob.core.windows.net/ StorageAccessKey :

CDbJ5eqkPiR+mfmlHFRMVNtLyUMNn8asHs3ulyFeSUyi/byg0JCofVh5/8hX4qE8GHoHtnQmIeAzwBTHC2hlvg== Password : BackupSystemDbs : True

BackupScheduleType : Manual FullBackupFrequency : Daily FullBackupStartTime : 10

-------------------------- Example 5: Create an automatic backup configuration with automated backup schedule --------------------------



$storageUrl = 'https://stocrptestps9662.blob.core.windows.net/'

$storageKey = ConvertTo-SecureString -String CDbJ5eqkPiR+mfmlHFRMVNtLyUMNn8asHs3ulyFeSUyibyg0JCofVh5/8hX4qE8GHoHtnQmIeAzwBTHC2hlvg== -AsPlainText -Force

$backupConfig=New-AzureVMSqlServerAutoBackupConfig -Enable -ResourceGroupName crptestps9662 -BackupSystemDbs -BackupScheduleType Automated

-RetentionPeriodInDays 10 -StorageUri $storageUrl -StorageKey $storageKey



This command creates and stores an automatic backup configuration object. The command specifies automated backup schedule.



Enable : True EnableEncryption : False RetentionPeriod : 10 StorageUrl :

https://stocrptestps9662.blob.core.windows.net/ StorageAccessKey :

CDbJ5eqkPiR+mfmlHFRMVNtLyUMNn8asHs3ulyFeSUyi/byg0JCofVh5/8hX4qE8GHoHtnQmIeAzwBTHC2hlvg== Password : BackupSystemDbs : True

BackupScheduleType : Automated FullBackupFrequency : FullBackupStartTime :



RELATED LINKS

New-AzureVMSqlServerAutoPatchingConfig