New-AzDataProtectionBackupConfigurationClientObject
Creates new backup configuration object
Syntax
Default (Default)
New-AzDataProtectionBackupConfigurationClientObject
-DatasourceType <DatasourceTypes>
[-ExcludedResourceType <String[]>]
[-IncludedResourceType <String[]>]
[-ExcludedNamespace <String[]>]
[-IncludedNamespace <String[]>]
[-LabelSelector <String[]>]
[-SnapshotVolume <Boolean>]
[-IncludeClusterScopeResource <Boolean>]
[-BackupHookReference <NamespacedNameResource[]>]
[-VaultedBackupContainer <String[]>]
[-IncludeAllContainer]
[-StorageAccountName <String>]
[-StorageAccountResourceGroupName <String>]
[-AutoProtection]
[-AutoProtectionExclusionRule <IBlobBackupAutoProtectionRule[]>]
[<CommonParameters>]
Description
Creates new backup configuration object
Examples
Example 1: Create a BackupConfiguration for configuring protection with AzureKubernetesService
$backupConfig = New-AzDataProtectionBackupConfigurationClientObject -SnapshotVolume $true -IncludeClusterScopeResource $true -DatasourceType AzureKubernetesService -LabelSelector "key=val","foo=bar" -ExcludedNamespace "excludeNS1","excludeNS2" -BackupHookReference @(@{name='bkphookname';namespace='default'},@{name='bkphookname1';namespace='hrweb'})
ObjectType ExcludedNamespace ExcludedResourceType IncludeClusterScopeResource IncludedNamespace IncludedResourceType LabelSelector SnapshotVolume
---------- ----------------- -------------------- --------------------------- ----------------- -------------------- ------------- --------------
KubernetesClusterBackupDatasourceParameters {excludeNS1, excludeNS2} True {key=val, foo=bar} True
This command can be used to create a backup configuration client object used for configuring backup for a Kubernetes cluster.
BackupHookReferences is a list of references to BackupHooks that should be executed before and after the backup is executed.
Example 2: Create a BackupConfiguration to select specific containers for configuring vaulted backups for AzureBlob.
$storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName
$containers=Get-AzStorageContainer -Context $storageAccount.Context
$backupConfig = New-AzDataProtectionBackupConfigurationClientObject -DatasourceType AzureBlob -VaultedBackupContainer $containers.Name[1,3,4]
ObjectType ContainersList
---------- --------------
BlobBackupDatasourceParameters {conabb, conwxy, conzzz}
This command can be used to create a backup configuration client object used for configuring backup for vaulted Blob backup containers.
Example 3: Create a BackupConfiguration for enabling auto-protection for AzureBlob.
$backupConfig = New-AzDataProtectionBackupConfigurationClientObject -DatasourceType AzureBlob -AutoProtection
ObjectType AutoProtectionSettingEnabled AutoProtectionSettingObjectType
---------- --------------------------- ------------------------------
BlobBackupDatasourceParametersForAutoProtection True BlobBackupRuleBasedAutoProtectionSettings
This command creates a backup configuration client object with auto-protection enabled for Azure Blob.
When auto-protection is enabled, new containers will be automatically protected without requiring manual configuration.
Example 4: Create a BackupConfiguration for enabling auto-protection for AzureDataLakeStorage with exclusion rules.
$rule = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BlobBackupAutoProtectionRule]::new()
$rule.ObjectType = "BlobBackupAutoProtectionRule"
$rule.Pattern = "logs-"
$backupConfig = New-AzDataProtectionBackupConfigurationClientObject -DatasourceType AzureDataLakeStorage -AutoProtection -AutoProtectionExclusionRule @($rule)
ObjectType AutoProtectionSettingEnabled AutoProtectionSettingObjectType
---------- --------------------------- ------------------------------
AdlsBlobBackupDatasourceParametersForAutoProtection True BlobBackupRuleBasedAutoProtectionSettings
This command creates a backup configuration client object with auto-protection enabled for Azure Data Lake Storage.
The exclusion rule excludes containers whose names match the prefix "logs-" from auto-protection.
Parameters
-AutoProtection
Switch parameter to enable auto-protection.
When enabled, new containers matching the rules will be automatically protected.
Use this parameter for DatasourceType AzureBlob or AzureDataLakeStorage.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AutoProtectionExclusionRule
List of auto-protection exclusion rules.
Each rule is a BlobBackupAutoProtectionRule object specifying container name prefix patterns to exclude.
Use this parameter along with -AutoProtection.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackupHookReference
Hook reference to be executed during backup.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DatasourceType
Datasource Type
Parameter properties
Type: DatasourceTypes
Default value: None
Accepted values: AzureDisk, AzureBlob, AzureDatabaseForPostgreSQL, AzureDataLakeStorage, AzureKubernetesService, AzureDatabaseForPGFlexServer, AzureDatabaseForMySQL, AzureCosmosDB
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ExcludedNamespace
List of namespaces to be excluded from backup
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ExcludedResourceType
List of resource types to be excluded from backup
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IncludeAllContainer
Switch parameter to include all containers to be backed up inside the VaultStore.
Use this parameter for DatasourceType AzureBlob.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IncludeClusterScopeResource
Boolean parameter to decide whether cluster scope resources are included for backup.
By default this is taken as true.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IncludedNamespace
List of namespaces to be included for backup
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IncludedResourceType
List of resource types to be included for backup
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LabelSelector
List of labels for internal filtering for backup
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SnapshotVolume
Boolean parameter to decide whether snapshot volumes are included for backup.
By default this is taken as true.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageAccountName
Storage account where the Datasource is present.
Use this parameter for DatasourceType AzureBlob.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageAccountResourceGroupName
Storage account resource group name where the Datasource is present.
Use this parameter for DatasourceType AzureBlob.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VaultedBackupContainer
List of containers to be backed up inside the VaultStore.
Use this parameter for DatasourceType AzureBlob.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs