New-AzureVMSqlServerAutoBackupConfig

Creates a configuration object for SQL Server automatic backup.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Syntax

New-AzureVMSqlServerAutoBackupConfig
   [-Enable]
   [[-RetentionPeriodInDays] <Int32>]
   [-EnableEncryption]
   [[-CertificatePassword] <SecureString>]
   [[-StorageUri] <Uri>]
   [[-StorageKey] <SecureString>]
   [-BackupSystemDbs]
   [-BackupScheduleType <String>]
   [-FullBackupFrequency <String>]
   [-FullBackupStartHour <Int32>]
   [-FullBackupWindowInHours <Int32>]
   [-LogBackupFrequencyInMinutes <Int32>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
New-AzureVMSqlServerAutoBackupConfig
   [-Enable]
   [[-RetentionPeriodInDays] <Int32>]
   [-EnableEncryption]
   [[-CertificatePassword] <SecureString>]
   [[-StorageContext] <AzureStorageContext>]
   [[-StorageUri] <Uri>]
   [[-StorageKey] <SecureString>]
   [-BackupSystemDbs]
   [-BackupScheduleType <String>]
   [-FullBackupFrequency <String>]
   [-FullBackupStartHour <Int32>]
   [-FullBackupWindowInHours <Int32>]
   [-LogBackupFrequencyInMinutes <Int32>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

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

Examples

Example 1: Create an auto-backup 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 auto-backup 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 auto-backup 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.

Parameters

-BackupScheduleType

Backup schedule type, manual or automated

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

-BackupSystemDbs

Backup system databases

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

-CertificatePassword

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

Type:SecureString
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Enable

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.

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

-EnableEncryption

Indicates that encryption is enabled.

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

-FullBackupFrequency

Sql Server Full Backup frequency, daily or week

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

-FullBackupStartHour

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

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

-FullBackupWindowInHours

Sql Server Full Backup window in hours

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

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-LogBackupFrequencyInMinutes

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

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

-Profile

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

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

-RetentionPeriodInDays

Specifies the length of the retention period in days.

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

-StorageContext

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

Type:AzureStorageContext
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StorageKey

Specifies the storage key of the blob storage account.

Type:SecureString
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StorageUri

Specifies a URI to the blob storage account.

Type:Uri
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False