Skip to content

Commit a579656

Browse files
authored
[Az.DataProtection] Added support for Cross region restore for Backup vaults (#23818)
* Added support for Cross region restore for Backup vaults * fixed Analyse issues * re-recorded failed tests * resolved issue with HttpPipelinePrepend * added no-inline
1 parent 9384df8 commit a579656

File tree

127 files changed

+5123
-5413
lines changed

Some content is hidden

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

127 files changed

+5123
-5413
lines changed

src/DataProtection/DataProtection.Autorest/Az.DataProtection.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.DataProtection.private.dll'
1313
FormatsToProcess = './Az.DataProtection.format.ps1xml'
14-
FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc', 'Edit-AzDataProtectionPolicyRetentionRuleClientObject', 'Edit-AzDataProtectionPolicyTagClientObject', 'Edit-AzDataProtectionPolicyTriggerClientObject', 'Find-AzDataProtectionRestorableTimeRange', 'Get-AzDataProtectionBackupInstance', 'Get-AzDataProtectionBackupPolicy', 'Get-AzDataProtectionBackupVault', 'Get-AzDataProtectionJob', 'Get-AzDataProtectionOperation', 'Get-AzDataProtectionOperationStatus', 'Get-AzDataProtectionPolicyTemplate', 'Get-AzDataProtectionRecoveryPoint', 'Get-AzDataProtectionResourceGuard', 'Get-AzDataProtectionResourceGuardMapping', 'Get-AzDataProtectionSoftDeletedBackupInstance', 'Initialize-AzDataProtectionBackupInstance', 'Initialize-AzDataProtectionRestoreRequest', 'New-AzDataProtectionBackupConfigurationClientObject', 'New-AzDataProtectionBackupInstance', 'New-AzDataProtectionBackupPolicy', 'New-AzDataProtectionBackupVault', 'New-AzDataProtectionBackupVaultStorageSettingObject', 'New-AzDataProtectionPolicyTagCriteriaClientObject', 'New-AzDataProtectionPolicyTriggerScheduleClientObject', 'New-AzDataProtectionResourceGuard', 'New-AzDataProtectionRestoreConfigurationClientObject', 'New-AzDataProtectionRetentionLifeCycleClientObject', 'Remove-AzDataProtectionBackupInstance', 'Remove-AzDataProtectionBackupPolicy', 'Remove-AzDataProtectionBackupVault', 'Remove-AzDataProtectionResourceGuard', 'Remove-AzDataProtectionResourceGuardMapping', 'Resume-AzDataProtectionBackupInstanceProtection', 'Search-AzDataProtectionBackupInstanceInAzGraph', 'Search-AzDataProtectionJobInAzGraph', 'Set-AzDataProtectionMSIPermission', 'Set-AzDataProtectionResourceGuardMapping', 'Start-AzDataProtectionBackupInstanceRestore', 'Stop-AzDataProtectionBackupInstanceProtection', 'Suspend-AzDataProtectionBackupInstanceBackup', 'Sync-AzDataProtectionBackupInstance', 'Test-AzDataProtectionBackupInstanceReadiness', 'Test-AzDataProtectionBackupInstanceRestore', 'Undo-AzDataProtectionBackupInstanceDeletion', 'Unlock-AzDataProtectionResourceGuardOperation', 'Update-AzDataProtectionBackupInstanceAssociatedPolicy', 'Update-AzDataProtectionBackupVault', 'Update-AzDataProtectionResourceGuard', '*'
14+
FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc', 'Edit-AzDataProtectionPolicyRetentionRuleClientObject', 'Edit-AzDataProtectionPolicyTagClientObject', 'Edit-AzDataProtectionPolicyTriggerClientObject', 'Find-AzDataProtectionRestorableTimeRange', 'Get-AzDataProtectionBackupInstance', 'Get-AzDataProtectionBackupPolicy', 'Get-AzDataProtectionBackupVault', 'Get-AzDataProtectionJob', 'Get-AzDataProtectionOperation', 'Get-AzDataProtectionOperationStatus', 'Get-AzDataProtectionPolicyTemplate', 'Get-AzDataProtectionRecoveryPoint', 'Get-AzDataProtectionResourceGuard', 'Get-AzDataProtectionResourceGuardMapping', 'Get-AzDataProtectionSoftDeletedBackupInstance', 'Initialize-AzDataProtectionBackupInstance', 'Initialize-AzDataProtectionRestoreRequest', 'New-AzDataProtectionBackupConfigurationClientObject', 'New-AzDataProtectionBackupInstance', 'New-AzDataProtectionBackupPolicy', 'New-AzDataProtectionBackupVault', 'New-AzDataProtectionBackupVaultStorageSettingObject', 'New-AzDataProtectionPolicyTagCriteriaClientObject', 'New-AzDataProtectionPolicyTriggerScheduleClientObject', 'New-AzDataProtectionResourceGuard', 'New-AzDataProtectionRestoreConfigurationClientObject', 'New-AzDataProtectionRetentionLifeCycleClientObject', 'Remove-AzDataProtectionBackupInstance', 'Remove-AzDataProtectionBackupPolicy', 'Remove-AzDataProtectionBackupVault', 'Remove-AzDataProtectionResourceGuard', 'Remove-AzDataProtectionResourceGuardMapping', 'Resume-AzDataProtectionBackupInstanceProtection', 'Search-AzDataProtectionBackupInstanceInAzGraph', 'Search-AzDataProtectionBackupVaultInAzGraph', 'Search-AzDataProtectionJobInAzGraph', 'Set-AzDataProtectionMSIPermission', 'Set-AzDataProtectionResourceGuardMapping', 'Start-AzDataProtectionBackupInstanceRestore', 'Stop-AzDataProtectionBackupInstanceProtection', 'Suspend-AzDataProtectionBackupInstanceBackup', 'Sync-AzDataProtectionBackupInstance', 'Test-AzDataProtectionBackupInstanceReadiness', 'Test-AzDataProtectionBackupInstanceRestore', 'Undo-AzDataProtectionBackupInstanceDeletion', 'Unlock-AzDataProtectionResourceGuardOperation', 'Update-AzDataProtectionBackupInstanceAssociatedPolicy', 'Update-AzDataProtectionBackupVault', 'Update-AzDataProtectionResourceGuard', '*'
1515
AliasesToExport = '*'
1616
PrivateData = @{
1717
PSData = @{

src/DataProtection/DataProtection.Autorest/README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ This file contains the configuration for generating My API from the OpenAPI spec
3434
3535
``` yaml
3636
# it's the same options as command line options, just drop the double-dash!
37-
commit: acf24167b5174d88f36302e243c883f2e63eec52
37+
commit: c0e7b1360c19187fde2497251f784aa82641aa95
3838
require:
3939
- $(this-folder)/../../readme.azure.noprofile.md
4040
input-file:
41-
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/dataprotection.json
41+
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/dataprotection.json
4242
title: DataProtection
4343
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
4444
use-extension:
@@ -236,6 +236,10 @@ directive:
236236
verb: Start
237237
subject: ExportJob
238238
remove: true
239+
- where:
240+
verb: Start
241+
subject: .*Restore$
242+
hide: true
239243
- where:
240244
verb: Get
241245
subject: OperationResultPatch
@@ -306,6 +310,23 @@ directive:
306310
subject: BackupInstanceRestore
307311
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
308312
hide: true
313+
- where:
314+
verb: Test
315+
subject: BackupInstanceCrossRegionRestore
316+
hide: true
317+
- where:
318+
subject: FetchCrossRegionRestoreJob
319+
set:
320+
subject: CrossRegionRestoreJob
321+
- where:
322+
subject: CrossRegionRestoreJob
323+
variant: ^Get.*
324+
set:
325+
subject: CrossRegionRestoreJobDetail
326+
- where:
327+
verb: Get
328+
subject: ^Job$|^CrossRegionRestoreJob.*|FetchSecondaryRecoveryPoint
329+
hide: true
309330
- where:
310331
property-name: AzureMonitorAlertSettingAlertsForAllJobFailure
311332
set:
@@ -363,6 +384,8 @@ directive:
363384
- IdentityType
364385
- no-inline:
365386
- BackupInstance
387+
- CrossRegionRestoreDetails
388+
- CrossRegionRestoreRequestObject
366389
- DeletionInfo
367390
- InnerError
368391
- ItemLevelRestoreTargetInfo
@@ -374,19 +397,20 @@ directive:
374397
- SecretStoreResource
375398
- SystemData
376399
- UserFacingError
377-
- ValidateRestoreRequestObject
400+
- ValidateRestoreRequestObject
401+
- ValidateCrossRegionRestoreRequestObject
378402
- from: source-file-csharp
379403
where: $
380-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IBaseBackupPolicy Property');
404+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IBaseBackupPolicy Property');
381405
- from: source-file-csharp
382406
where: $
383-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.ITriggerContext Trigger');
407+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.ITriggerContext Trigger');
384408
- from: source-file-csharp
385409
where: $
386-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IBackupParameters BackupParameter');
410+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IBackupParameters BackupParameter');
387411
- from: source-file-csharp
388412
where: $
389-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.IAzureBackupRecoveryPoint Property');
413+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.IAzureBackupRecoveryPoint Property');
390414
```
391415
392416
## Alternate settings

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupInstances-recoveryPoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupInstances/recoveryPoints",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupInstances.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupInstances",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupJobs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"resourceType": "backupVaults/backupJobs",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},
77
"commands": [
88
{
99
"name": "Get-AzDataProtectionJob",
10-
"description": "Gets a job with id in a backup vault",
10+
"description": "Gets or lists jobs in a backup vault",
1111
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}",
1212
"help": {
1313
"learnMore": {

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupPolicies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupPolicies",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupResourceGuardProxies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupResourceGuardProxies",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-deletedBackupInstances.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/deletedBackupInstances",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/locations-operationStatus.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "locations/operationStatus",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/resourceGuards.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "resourceGuards",
3-
"apiVersion": "2023-05-01",
3+
"apiVersion": "2023-11-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Backupcenter/Search-AzDataProtectionBackupInstanceInAzGraph.ps1

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,53 @@
2323

2424
[Parameter(Mandatory=$false, HelpMessage='Protection Status of the item')]
2525
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.ProtectionStatus[]]
26-
${ProtectionStatus}
26+
${ProtectionStatus},
27+
28+
[Parameter()]
29+
[Alias('AzureRMContext', 'AzureCredential')]
30+
[ValidateNotNull()]
31+
[System.Management.Automation.PSObject]
32+
# The credentials, account, tenant, and subscription used for communication with Azure.
33+
${DefaultProfile},
34+
35+
[Parameter(DontShow)]
36+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
37+
[System.Management.Automation.SwitchParameter]
38+
# Wait for .NET debugger to attach
39+
${Break},
40+
41+
[Parameter(DontShow)]
42+
[ValidateNotNull()]
43+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
44+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
45+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
46+
${HttpPipelineAppend},
47+
48+
[Parameter(DontShow)]
49+
[ValidateNotNull()]
50+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
51+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
52+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
53+
${HttpPipelinePrepend},
54+
55+
[Parameter(DontShow)]
56+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
57+
[System.Uri]
58+
# The URI for the proxy server to use
59+
${Proxy},
60+
61+
[Parameter(DontShow)]
62+
[ValidateNotNull()]
63+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
64+
[System.Management.Automation.PSCredential]
65+
# Credentials for a proxy server to use for the remote call
66+
${ProxyCredential},
67+
68+
[Parameter(DontShow)]
69+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
70+
[System.Management.Automation.SwitchParameter]
71+
# Use the default credentials for the proxy
72+
${ProxyUseDefaultCredentials}
2773
)
2874

2975
process
@@ -49,13 +95,14 @@
4995
$null = $PSBoundParameters.Add("Subscription", $Subscription)
5096
$null = $PSBoundParameters.Add("query", $query)
5197
$null = $PSBoundParameters.Add("First", 1000)
98+
$null = $PSBoundParameters.Remove("HttpPipelinePrepend")
5299

53100
$argInstanceResponse = Az.ResourceGraph\Search-AzGraph @PSBoundParameters
54101
$backupInstances = @()
55102
foreach($argResponse in $argInstanceResponse)
56103
{
57104
$jsonStringResponse = $argResponse | ConvertTo-Json -Depth 100
58-
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20230501.BackupInstanceResource]::FromJsonString($jsonStringResponse)
105+
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.BackupInstanceResource]::FromJsonString($jsonStringResponse)
59106
}
60107
return $backupInstances
61108
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
function Search-AzDataProtectionBackupVaultInAzGraph
2+
{
3+
[OutputType('PSObject')]
4+
[CmdletBinding(PositionalBinding=$false)]
5+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Searches for Backup vaults in Azure Resource Graph and retrieves the expected entries')]
6+
7+
param (
8+
[Parameter(Mandatory, HelpMessage='Subscription of Vault')]
9+
[System.String[]]
10+
${Subscription},
11+
12+
[Parameter(Mandatory=$false, HelpMessage='Resource Group of Vault')]
13+
[System.String[]]
14+
${ResourceGroup},
15+
16+
[Parameter(Mandatory=$false, HelpMessage='Name of the vault')]
17+
[System.String[]]
18+
${Vault},
19+
20+
[Parameter()]
21+
[Alias('AzureRMContext', 'AzureCredential')]
22+
[ValidateNotNull()]
23+
[System.Management.Automation.PSObject]
24+
# The credentials, account, tenant, and subscription used for communication with Azure.
25+
${DefaultProfile},
26+
27+
[Parameter(DontShow)]
28+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
29+
[System.Management.Automation.SwitchParameter]
30+
# Wait for .NET debugger to attach
31+
${Break},
32+
33+
[Parameter(DontShow)]
34+
[ValidateNotNull()]
35+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
36+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
37+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
38+
${HttpPipelineAppend},
39+
40+
[Parameter(DontShow)]
41+
[ValidateNotNull()]
42+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
43+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
44+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
45+
${HttpPipelinePrepend},
46+
47+
[Parameter(DontShow)]
48+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
49+
[System.Uri]
50+
# The URI for the proxy server to use
51+
${Proxy},
52+
53+
[Parameter(DontShow)]
54+
[ValidateNotNull()]
55+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
56+
[System.Management.Automation.PSCredential]
57+
# Credentials for a proxy server to use for the remote call
58+
${ProxyCredential},
59+
60+
[Parameter(DontShow)]
61+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
62+
[System.Management.Automation.SwitchParameter]
63+
# Use the default credentials for the proxy
64+
${ProxyUseDefaultCredentials}
65+
)
66+
67+
process
68+
{
69+
CheckResourceGraphModuleDependency
70+
71+
# $manifest = LoadManifest -DatasourceType $DatasourceType
72+
$query = GetBackupVaultARGQuery
73+
74+
if($PSBoundParameters.ContainsKey("ResourceGroup")){ $query = AddFilterToQuery -Query $query -FilterKey "resourceGroup" -FilterValues $ResourceGroup }
75+
if($PSBoundParameters.ContainsKey("Vault")){ $query = AddFilterToQuery -Query $query -FilterKey "name" -FilterValues $Vault }
76+
77+
foreach($param in @("Subscription", "ResourceGroup", "Vault"))
78+
{
79+
if($PSBoundParameters.ContainsKey($param))
80+
{
81+
$null = $PSBoundParameters.Remove($param)
82+
}
83+
}
84+
$null = $PSBoundParameters.Add("Subscription", $Subscription)
85+
$null = $PSBoundParameters.Add("query", $query)
86+
$null = $PSBoundParameters.Add("First", 1000)
87+
$null = $PSBoundParameters.Remove("HttpPipelinePrepend")
88+
89+
$argAllVaults = Az.ResourceGraph\Search-AzGraph @PSBoundParameters
90+
$backupVaults = @()
91+
foreach($argVault in $argAllVaults)
92+
{
93+
$jsonStringResponse = $argVault | ConvertTo-Json -Depth 100
94+
$backupVaults += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231101.BackupVaultResource]::FromJsonString($jsonStringResponse)
95+
}
96+
return $backupVaults
97+
}
98+
}

0 commit comments

Comments
 (0)