Skip to content

Commit c2895db

Browse files
azure-powershell-botLei Jinhiaga
authored
Migrate DataProtection from generation to main (#21794)
* Move DataProtection to main * Copy BreakingChangeIssues.csv of DataProtection to main * Updated change log (#21803) --------- Co-authored-by: Lei Jin <[email protected]> Co-authored-by: Himanshu Agarwal <[email protected]>
1 parent 403abe5 commit c2895db

File tree

54 files changed

+6470
-3665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6470
-3665
lines changed

src/DataProtection/Az.DataProtection.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 3/30/2023
6+
# Generated on: 5/15/2023
77
#
88

99
@{
@@ -78,6 +78,7 @@ FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc',
7878
'Get-AzDataProtectionBackupPolicy',
7979
'Get-AzDataProtectionBackupVault', 'Get-AzDataProtectionJob',
8080
'Get-AzDataProtectionOperation',
81+
'Get-AzDataProtectionOperationStatus',
8182
'Get-AzDataProtectionPolicyTemplate',
8283
'Get-AzDataProtectionRecoveryPoint',
8384
'Get-AzDataProtectionResourceGuard',
@@ -147,8 +148,7 @@ PrivateData = @{
147148
# IconUri = ''
148149

149150
# ReleaseNotes of this module
150-
ReleaseNotes = '* Added support for AKS workload with Backup Vaults
151-
* Added support for ''Set-AzDataProtectionMSIPermission'' during restore with AKS workload'
151+
# ReleaseNotes = ''
152152

153153
# Prerelease string of this module
154154
# Prerelease = ''

src/DataProtection/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added support for Blob Hardened recovery points (VaultStore).
22+
* Added Cross Subscription Restore for AzureDisk, AzureDatabaseForPostgreSQL and AzureBlob.
23+
* Added Get-AzDataProtectionOperationStatus command for long running cmdlets Async.
2124

2225
## Version 1.2.0
2326
* Added support for AKS workload with Backup Vaults

src/DataProtection/DataProtection.sln

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{6D3A248D-F296-43D6-9962-673542D240AB}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{82B11EC5-4480-4EE8-B93E-1A082DADEB26}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{4D25E267-5BFD-4E55-A49D-6B69DB8639E2}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{C3561EE6-74CB-4840-B794-32951E578A7A}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{3C107874-EACD-4B98-8C9A-CDB605995658}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{AA2B259B-DE0C-4A95-AC02-57B31D00D1D5}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{B57DDA22-4307-454D-ADA3-01C3417EC35D}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{BD3EE0EA-A603-449C-8AFE-DA0D1964704F}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{3B3FA978-2B8E-40FD-9649-3F3763A2FFE5}"
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{806D1F89-E60F-44E7-B856-E5702CC02765}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{C1F620E5-B91E-4FA4-B2E1-EEA3E3F11FC5}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{04312EFD-C13D-4F56-8CAD-3C082AD953F8}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataProtection", "Az.DataProtection.csproj", "{0A8E1C5D-64DA-4492-A2FE-E08AABF67EF6}"
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataProtection", "Az.DataProtection.csproj", "{3E76A926-D93C-49DA-BE08-14398C042888}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -26,33 +26,33 @@ Global
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
2828
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{6D3A248D-F296-43D6-9962-673542D240AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{6D3A248D-F296-43D6-9962-673542D240AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{6D3A248D-F296-43D6-9962-673542D240AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{6D3A248D-F296-43D6-9962-673542D240AB}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{4D25E267-5BFD-4E55-A49D-6B69DB8639E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{4D25E267-5BFD-4E55-A49D-6B69DB8639E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{4D25E267-5BFD-4E55-A49D-6B69DB8639E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{4D25E267-5BFD-4E55-A49D-6B69DB8639E2}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{3C107874-EACD-4B98-8C9A-CDB605995658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{3C107874-EACD-4B98-8C9A-CDB605995658}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{3C107874-EACD-4B98-8C9A-CDB605995658}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{3C107874-EACD-4B98-8C9A-CDB605995658}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{B57DDA22-4307-454D-ADA3-01C3417EC35D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{B57DDA22-4307-454D-ADA3-01C3417EC35D}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{B57DDA22-4307-454D-ADA3-01C3417EC35D}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{B57DDA22-4307-454D-ADA3-01C3417EC35D}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{3B3FA978-2B8E-40FD-9649-3F3763A2FFE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{3B3FA978-2B8E-40FD-9649-3F3763A2FFE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{3B3FA978-2B8E-40FD-9649-3F3763A2FFE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
48-
{3B3FA978-2B8E-40FD-9649-3F3763A2FFE5}.Release|Any CPU.Build.0 = Release|Any CPU
49-
{C1F620E5-B91E-4FA4-B2E1-EEA3E3F11FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{C1F620E5-B91E-4FA4-B2E1-EEA3E3F11FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
51-
{C1F620E5-B91E-4FA4-B2E1-EEA3E3F11FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
52-
{C1F620E5-B91E-4FA4-B2E1-EEA3E3F11FC5}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{0A8E1C5D-64DA-4492-A2FE-E08AABF67EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{0A8E1C5D-64DA-4492-A2FE-E08AABF67EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{0A8E1C5D-64DA-4492-A2FE-E08AABF67EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
56-
{0A8E1C5D-64DA-4492-A2FE-E08AABF67EF6}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{82B11EC5-4480-4EE8-B93E-1A082DADEB26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{82B11EC5-4480-4EE8-B93E-1A082DADEB26}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{82B11EC5-4480-4EE8-B93E-1A082DADEB26}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{82B11EC5-4480-4EE8-B93E-1A082DADEB26}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{C3561EE6-74CB-4840-B794-32951E578A7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{C3561EE6-74CB-4840-B794-32951E578A7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{C3561EE6-74CB-4840-B794-32951E578A7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{C3561EE6-74CB-4840-B794-32951E578A7A}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{AA2B259B-DE0C-4A95-AC02-57B31D00D1D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{AA2B259B-DE0C-4A95-AC02-57B31D00D1D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{AA2B259B-DE0C-4A95-AC02-57B31D00D1D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{AA2B259B-DE0C-4A95-AC02-57B31D00D1D5}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{BD3EE0EA-A603-449C-8AFE-DA0D1964704F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{BD3EE0EA-A603-449C-8AFE-DA0D1964704F}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{BD3EE0EA-A603-449C-8AFE-DA0D1964704F}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{BD3EE0EA-A603-449C-8AFE-DA0D1964704F}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{806D1F89-E60F-44E7-B856-E5702CC02765}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{806D1F89-E60F-44E7-B856-E5702CC02765}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{806D1F89-E60F-44E7-B856-E5702CC02765}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{806D1F89-E60F-44E7-B856-E5702CC02765}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{04312EFD-C13D-4F56-8CAD-3C082AD953F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{04312EFD-C13D-4F56-8CAD-3C082AD953F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{04312EFD-C13D-4F56-8CAD-3C082AD953F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{04312EFD-C13D-4F56-8CAD-3C082AD953F8}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{3E76A926-D93C-49DA-BE08-14398C042888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{3E76A926-D93C-49DA-BE08-14398C042888}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{3E76A926-D93C-49DA-BE08-14398C042888}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{3E76A926-D93C-49DA-BE08-14398C042888}.Release|Any CPU.Build.0 = Release|Any CPU
5757
EndGlobalSection
5858
EndGlobal

src/DataProtection/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,6 @@ directive:
163163
verb: Sync
164164
variant: Sync$|SyncViaIdentity$|SyncViaIdentityExpanded$
165165
remove: true
166-
- where:
167-
verb: Get
168-
subject: OperationResult
169-
remove: true
170-
- where:
171-
verb: Get
172-
subject: OperationStatus
173-
remove: true
174166
- where:
175167
verb: Start
176168
subject: BackupInstanceRehydrate
@@ -269,6 +261,16 @@ directive:
269261
property-name: SoftDeleteSettingState
270262
set:
271263
property-name: SoftDeleteState
264+
- where:
265+
subject: OperationStatus
266+
parameter-name: Location
267+
set:
268+
parameter-description: Azure region where the operation is triggered.
269+
- where:
270+
subject: OperationStatus
271+
parameter-name: OperationId
272+
set:
273+
parameter-description: Operation Id to track the operation status.
272274
- where:
273275
model-name: BackupVaultResource
274276
set:

src/DataProtection/custom/Cmdlets/Common/Initialize-AzDataProtectionBackupInstance.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function Initialize-AzDataProtectionBackupInstance {
4444
${FriendlyName},
4545

4646
[Parameter(Mandatory=$false, HelpMessage='Backup configuration for backup. Use this parameter to configure protection for AzureKubernetesService.')]
47-
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202301.KubernetesClusterBackupDatasourceParameters]
47+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202301.IBackupDatasourceParameters]
4848
${BackupConfiguration}
4949
)
5050

@@ -145,13 +145,15 @@ function Initialize-AzDataProtectionBackupInstance {
145145
}
146146

147147
if($manifest.addBackupDatasourceParametersList -eq $true)
148-
{
149-
if($BackupConfiguration -eq $null){
150-
$errormsg = "Please input parameter BackupConfiguration for AKS cluster backup. Use command New-AzDataProtectionBackupConfigurationClientObject for creating the BackupConfiguration"
148+
{
149+
if($BackupConfiguration -eq $null -and $manifest.backupConfigurationRequired -eq $true){
150+
$errormsg = "Please input parameter BackupConfiguration for given DatasourceType. Use command New-AzDataProtectionBackupConfigurationClientObject for creating the BackupConfiguration."
151151
throw $errormsg
152152
}
153153

154-
$backupInstanceResource.Property.PolicyInfo.PolicyParameter.BackupDatasourceParametersList += @($BackupConfiguration)
154+
if($BackupConfiguration -ne $null){
155+
$backupInstanceResource.Property.PolicyInfo.PolicyParameter.BackupDatasourceParametersList += @($BackupConfiguration)
156+
}
155157
}
156158
elseif($ExcludedResourceType -ne $null -or $IncludedResourceType -ne $null -or $ExcludedNamespace -ne $null -or $IncludedNamespace -ne $null -or $LabelSelector -ne $null -or $SnapshotVolume -ne $null -or $IncludeClusterScopeResource -ne $null){
157159
$errormsg = "ExcludedResourceType, IncludedResourceType, ExcludedNamespace, IncludedNamespace, LabelSelector, SnapshotVolume, IncludeClusterScopeResource parameters are not applicable for given DatasourceType. Please ensure to remove them"

src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupConfigurationClientObject.ps1

Lines changed: 74 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function New-AzDataProtectionBackupConfigurationClientObject{
77
param(
88
[Parameter(Mandatory, HelpMessage='Datasource Type')]
99
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.DatasourceTypes]
10-
[ValidateSet('AzureKubernetesService')]
10+
[ValidateSet('AzureKubernetesService', 'AzureBlob')]
1111
${DatasourceType},
1212

1313
[Parameter(Mandatory=$false, HelpMessage='List of resource types to be excluded from backup')]
@@ -36,33 +36,87 @@ function New-AzDataProtectionBackupConfigurationClientObject{
3636

3737
[Parameter(Mandatory=$false, HelpMessage='Boolean parameter to decide whether cluster scope resources are included for backup. By default this is taken as true.')]
3838
[Nullable[System.Boolean]]
39-
${IncludeClusterScopeResource}
39+
${IncludeClusterScopeResource},
40+
41+
[Parameter(Mandatory=$false, HelpMessage='List of containers to be backed up inside the VaultStore. Use this parameter for DatasourceType AzureBlob.')]
42+
[System.String[]]
43+
${VaultedBackupContainer},
44+
45+
[Parameter(Mandatory=$false, HelpMessage='Switch parameter to include all containers to be backed up inside the VaultStore. Use this parameter for DatasourceType AzureBlob.')]
46+
[Switch]
47+
${IncludeAllContainer},
48+
49+
[Parameter(Mandatory=$false, HelpMessage='Storage account where the Datasource is present. Use this parameter for DatasourceType AzureBlob.')]
50+
[System.String]
51+
${StorageAccountName},
52+
53+
[Parameter(Mandatory=$false, HelpMessage='Storage account resource group name where the Datasource is present. Use this parameter for DatasourceType AzureBlob.')]
54+
[System.String]
55+
${StorageAccountResourceGroupName}
4056
)
4157

4258
process {
43-
# need to have parameter validation when this command supports another DatasourceType
59+
# need to have parameter validation when this command supports another DatasourceType
60+
$dataSourceParam = $null
61+
62+
if($DatasourceType.ToString() -eq "AzureKubernetesService"){
4463

45-
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202301.KubernetesClusterBackupDatasourceParameters]::new()
46-
$dataSourceParam.ObjectType = "KubernetesClusterBackupDatasourceParameters"
64+
# parameter validation
65+
if($VaultedBackupContainer -ne $null -or $IncludeAllContainer){
66+
$message = "Invalid parameter VaultedBackupContainer or IncludeAllContainer for given DatasourceType."
67+
throw $message
68+
}
69+
70+
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202301.KubernetesClusterBackupDatasourceParameters]::new()
71+
$dataSourceParam.ObjectType = "KubernetesClusterBackupDatasourceParameters"
4772

48-
$dataSourceParam.ExcludedResourceType = $ExcludedResourceType
49-
$dataSourceParam.IncludedResourceType = $IncludedResourceType
50-
$dataSourceParam.ExcludedNamespace = $ExcludedNamespace
51-
$dataSourceParam.IncludedNamespace = $IncludedNamespace
52-
$dataSourceParam.LabelSelector = $LabelSelector
73+
$dataSourceParam.ExcludedResourceType = $ExcludedResourceType
74+
$dataSourceParam.IncludedResourceType = $IncludedResourceType
75+
$dataSourceParam.ExcludedNamespace = $ExcludedNamespace
76+
$dataSourceParam.IncludedNamespace = $IncludedNamespace
77+
$dataSourceParam.LabelSelector = $LabelSelector
5378

54-
if ($SnapshotVolume -ne $null) {
55-
$dataSourceParam.SnapshotVolume = $SnapshotVolume
56-
}
57-
else{
58-
$dataSourceParam.SnapshotVolume = $true
59-
}
79+
if ($SnapshotVolume -ne $null) {
80+
$dataSourceParam.SnapshotVolume = $SnapshotVolume
81+
}
82+
else{
83+
$dataSourceParam.SnapshotVolume = $true
84+
}
6085

61-
if($IncludeClusterScopeResource -ne $null){
62-
$dataSourceParam.IncludeClusterScopeResource = $IncludeClusterScopeResource
86+
if($IncludeClusterScopeResource -ne $null){
87+
$dataSourceParam.IncludeClusterScopeResource = $IncludeClusterScopeResource
88+
}
89+
else{
90+
$dataSourceParam.IncludeClusterScopeResource = $true
91+
}
6392
}
64-
else{
65-
$dataSourceParam.IncludeClusterScopeResource = $true
93+
94+
if($DatasourceType.ToString() -eq "AzureBlob"){
95+
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202301.BlobBackupDatasourceParameters]::new()
96+
$dataSourceParam.ObjectType = "BlobBackupDatasourceParameters"
97+
98+
if($VaultedBackupContainer -ne $null){
99+
$dataSourceParam.ContainersList = $VaultedBackupContainer
100+
}
101+
elseif($IncludeAllContainer){
102+
if($StorageAcountName -eq $null -or $StorageAccountResourceGroupName -eq $null){
103+
$message = "Please input StorageAcountName and StorageAccountResourceGroupName parameters for fetching all vaulted containers."
104+
throw $message
105+
}
106+
107+
CheckStorageModuleDependency
108+
$storageAccount = Get-AzStorageAccount -ResourceGroupName $StorageAccountResourceGroupName -Name $StorageAcountName
109+
$containers=Get-AzStorageContainer -Context $storageAccount.Context
110+
$dataSourceParam.ContainersList = $containers.Name
111+
}
112+
elseif($ExcludedResourceType -ne $null -or $IncludedResourceType -ne $null -or $ExcludedNamespace -ne $null -or $IncludedNamespace -ne $null -or $LabelSelector -ne $null -or $SnapshotVolume -ne $null -or $IncludeClusterScopeResource -ne $null){
113+
$message = "Invalid parameters ExcludedResourceType, IncludedResourceType, ExcludedNamespace, IncludedNamespace, LabelSelector, SnapshotVolume, IncludeClusterScopeResource for given DatasourceType."
114+
throw $message
115+
}
116+
else {
117+
$message = "Please input VaultedBackupContainer or IncludeAllContainer parameters for given workload type."
118+
throw $message
119+
}
66120
}
67121

68122
$dataSourceParam

src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupInstance.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ function New-AzDataProtectionBackupInstance {
9090
$BackupInstance.Tag = $Tag
9191
}
9292

93-
$null = $PSBoundParameters.Add("BackupInstance", $BackupInstance.Property)
94-
$null = Az.DataProtection\Test-AzDataProtectionBackupInstanceReadiness @PSBoundParameters
95-
$null = $PSBoundParameters.Remove("BackupInstance")
93+
# commenting inline validate for now
94+
# $null = $PSBoundParameters.Add("BackupInstance", $BackupInstance.Property)
95+
# $null = Az.DataProtection\Test-AzDataProtectionBackupInstanceReadiness @PSBoundParameters
96+
# $null = $PSBoundParameters.Remove("BackupInstance")
97+
9698
$null = $PSBoundParameters.Add("Name", $name)
9799
$null = $PSBoundParameters.Add("Parameter", $BackupInstance)
98100
Az.DataProtection.Internal\New-AzDataProtectionBackupInstance @PSBoundParameters

0 commit comments

Comments
 (0)