Skip to content

Commit 68cdc03

Browse files
audunnisra-fel
andauthored
[NetAppFieles]Anf 6295 update for 2020 06 01 (#13387)
* Add cmdLets to support updates up to api-version 2020-06-01 * Updated help files * Updated test recordings * Update active directory and docs * Update docs * Revert c# newer feature not in pipeline * Fix missing language feature ci/cd issue in pipeline * Update tests and help * Add missing online link * update online link * Rename poolchange to switch, refactor activeDirectory * Update helpfile * Docs update * update docs * Rename Switch-AzNetAppFilesVolumePool to Set * Update tests for set volume pool * update tests recordings * trecording * update recordings * update rec * update recording * remove version in changelog Co-authored-by: Audunn Baldvinsson <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent c5ba59b commit 68cdc03

File tree

120 files changed

+67646
-9782
lines changed

Some content is hidden

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

120 files changed

+67646
-9782
lines changed

src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.6.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.7.0" />
1515
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
1616
</ItemGroup>
1717

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/AccountTests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ function Test-AccountActiveDirectory
2222
$accName1 = Get-ResourceName
2323
$accName2 = Get-ResourceName
2424
$accName3 = Get-ResourceName
25-
$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
26-
25+
#$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
26+
$resourceLocation = 'westus2'
27+
2728
$activeDirectory1 = @{
2829
Username = "sdkuser"
2930
<#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="...")]#>
@@ -57,7 +58,7 @@ function Test-AccountActiveDirectory
5758
$newTagValue = "tagValue1"
5859
#$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1 -Tag @{$newTagName = $newTagValue} -ActiveDirector $activeDirectories
5960

60-
Assert-ThrowsContains{ New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1 -Tag @{$newTagName = $newTagValue} -ActiveDirector $activeDirectories} 'Only one active directory allowed';
61+
Assert-ThrowsContains{ New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1 -Tag @{$newTagName = $newTagValue} -ActiveDirectory $activeDirectories} 'Only one active directory allowed';
6162
#Assert-True { $false }
6263
}
6364
catch
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest
19+
{
20+
public class ActiveDirectoryTests
21+
{
22+
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
23+
24+
public ActiveDirectoryTests(Xunit.Abstractions.ITestOutputHelper output)
25+
{
26+
_logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
27+
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
28+
}
29+
30+
[Fact]
31+
[Trait(Category.AcceptanceType, Category.CheckIn)]
32+
public void TestActiveDirectoryCrud()
33+
{
34+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ActiveDirectoryCrud");
35+
}
36+
37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestActiveDirectoryPipelines()
40+
{
41+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ActiveDirectoryPipelines");
42+
}
43+
}
44+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Test Active Directory cmdLet CRUD operations
18+
#>
19+
function Test-ActiveDirectoryCrud
20+
{
21+
$resourceGroup = Get-ResourceGroupName
22+
$accName1 = Get-ResourceName
23+
$activeDirectoryName1 = Get-ResourceName
24+
$activeDirectoryName2 = Get-ResourceName
25+
$accName2 = Get-ResourceName
26+
#$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
27+
$resourceLocation = 'westus2'
28+
$adUsername = "sdkuser"
29+
<#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="...")]#>
30+
$adPassword = "sdkpass"
31+
$adDomain = "sdkdomain"
32+
$adDns = "192.0.2.2"
33+
$adSmbServerName = "PSSMBSName"
34+
$adSmbServerName2 = "PSMBSName2"
35+
36+
try
37+
{
38+
# create the resource group
39+
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
40+
41+
# try creating an Account -
42+
$newTagName = "tag1"
43+
$newTagValue = "tagValue1"
44+
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1 -Tag @{$newTagName = $newTagValue}
45+
Assert-AreEqual $accName1 $retrievedAcc.Name
46+
$sPass = ConvertTo-SecureString $adPassword -AsPlainText -Force
47+
# create and check ActiveDirectory
48+
$retrievedAd = New-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1 -AdName $activeDirectoryName1 -Username $adUsername -Password $sPass -Domain $adDomain -Dns $adDns -SmbServerName $adSmbServerName
49+
$activeDirectoryId = $retrievedAd.ActiveDirectoryId
50+
Assert-AreEqual $adDomain $retrievedAd.Domain
51+
Assert-AreEqual $adUsername $retrievedAd.Username
52+
Assert-AreEqual $adDns $retrievedAd.Dns
53+
Assert-AreEqual $adSmbServerName $retrievedAd.SmbServerName
54+
55+
# get and check account
56+
$retrievedAcc = Get-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Name $accName1
57+
Assert-AreEqual $adSmbServerName $retrievedAcc.ActiveDirectories[0].SmbServerName
58+
Assert-AreEqual $adUsername $retrievedAcc.ActiveDirectories[0].Username
59+
60+
# get and check a ActiveDirectory by id and check again
61+
$getRetrievedAd = Get-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1 -ActiveDirectoryId $activeDirectoryId
62+
Assert-AreEqual $activeDirectoryName1 $getRetrievedAd.AdName
63+
Assert-AreEqual $adDomain $getRetrievedAd.Domain
64+
Assert-AreEqual $adUsername $getRetrievedAd.Username
65+
Assert-AreEqual $adDns $getRetrievedAd.Dns
66+
Assert-AreEqual $adSmbServerName $getRetrievedAd.SmbServerName
67+
68+
#update AD
69+
$getUpdateddAd = Update-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1 -ActiveDirectoryId $getRetrievedAd.ActiveDirectoryId -SmbServerName $adSmbServerName2 -Password $sPass
70+
Assert-AreEqual $adSmbServerName2 $getUpdateddAd.SmbServerName
71+
72+
# delete activeDirectory retrieved
73+
# but test the WhatIf first, should not be removed
74+
Remove-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1 -ActiveDirectoryId $getRetrievedAd.ActiveDirectoryId -WhatIf
75+
$retrievedActiveDirectoryList = Get-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1
76+
Assert-AreEqual 1 $retrievedActiveDirectoryList.Length
77+
78+
#remove by name
79+
Remove-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1 -ActiveDirectoryId $getRetrievedAd.ActiveDirectoryId
80+
Start-Sleep -s 15
81+
$retrievedActiveDirectoryList = Get-AzNetAppFilesActiveDirectory -ResourceGroupName $resourceGroup -AccountName $accName1
82+
Assert-AreEqual 0 $retrievedActiveDirectoryList.Length
83+
}
84+
finally
85+
{
86+
# Cleanup
87+
Clean-ResourceGroup $resourceGroup
88+
}
89+
}
90+
91+
<#
92+
.SYNOPSIS
93+
Test activeDirectory Pipeline operations (uses command aliases)
94+
#>
95+
function Test-ActiveDirectoryPipelines
96+
{
97+
$resourceGroup = Get-ResourceGroupName
98+
$accName1 = Get-ResourceName
99+
#$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
100+
$resourceLocation = 'westus2'
101+
$activeDirectoryName1 = Get-ResourceName
102+
$adUsername = "sdkuser"
103+
<#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="...")]#>
104+
$adPassword = "sdkpass"
105+
$adDomain = "sdkdomain"
106+
$adDns = "192.0.2.2"
107+
$adSmbServerName = "PSSMBSName"
108+
109+
try
110+
{
111+
# create the resource group
112+
New-AzResourceGroup -Name $resourceGroup -Location $resourceLocation
113+
114+
New-AnfAccount -ResourceGroupName $resourceGroup -Location $resourceLocation -Name $accName1
115+
$sPass = ConvertTo-SecureString $adPassword -AsPlainText -Force
116+
#create AD piping in Account
117+
$retrievedAd = Get-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Name $accName1 | New-AzNetAppFilesActiveDirectory -AdName $activeDirectoryName1 -Username $adUsername -Password $sPass -Domain $adDomain -Dns $adDns -SmbServerName $adSmbServerName
118+
119+
$getRetrievedAd = Get-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Name $accName1 | Get-AzNetAppFilesActiveDirectory -ActiveDirectoryId $retrievedAd.ActiveDirectoryId
120+
}
121+
finally
122+
{
123+
# Cleanup
124+
Clean-ResourceGroup $resourceGroup
125+
}
126+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest
19+
{
20+
public class BackupPolicyTests
21+
{
22+
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
23+
24+
public BackupPolicyTests(Xunit.Abstractions.ITestOutputHelper output)
25+
{
26+
_logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
27+
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
28+
}
29+
30+
[Fact]
31+
[Trait(Category.AcceptanceType, Category.CheckIn)]
32+
public void TestBackupPolicyCrud()
33+
{
34+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-BackupPolicyCrud");
35+
}
36+
37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestBackupPolicyPipelines()
40+
{
41+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-BackupPolicyPipelines");
42+
}
43+
}
44+
}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Test Backup Policy CRUD operations
18+
#>
19+
function Test-BackupPolicyCrud
20+
{
21+
$resourceGroup = Get-ResourceGroupName
22+
$accName1 = Get-ResourceName
23+
$backupPolicyName1 = Get-ResourceName
24+
$backupPolicyName2 = Get-ResourceName
25+
$accName2 = Get-ResourceName
26+
$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
27+
$dailyBackupsToKeep = 4
28+
$weeklyBackupsToKeep = 3
29+
$monthlyBackupsToKeep = 2
30+
$yearlyBackupsToKeep = 1
31+
$backupLocation = "southcentralus"
32+
33+
try
34+
{
35+
# create the resource group
36+
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation
37+
38+
# try creating an Account -
39+
$newTagName = "tag1"
40+
$newTagValue = "tagValue1"
41+
$retrievedAcc = New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $backupLocation -Name $accName1 -Tag @{$newTagName = $newTagValue}
42+
Assert-AreEqual $accName1 $retrievedAcc.Name
43+
44+
# create and check BackupPolicy
45+
$retrievedBackupPolicy = New-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -Location $backupLocation -AccountName $accName1 -Name $backupPolicyName1 -Tag @{$newTagName = $newTagValue} -Enabled -DailyBackupsToKeep $dailyBackupsToKeep -WeeklyBackupsToKeep $weeklyBackupsToKeep -MonthlyBackupsToKeep $monthlyBackupsToKeep -YearlyBackupsToKeep $yearlyBackupsToKeep
46+
Assert-AreEqual "$accName1/$backupPolicyName1" $retrievedBackupPolicy.Name
47+
Assert-True {$retrievedBackupPolicy.Enabled}
48+
Assert-AreEqual $dailyBackupsToKeep $retrievedBackupPolicy.DailyBackupsToKeep
49+
Assert-AreEqual $weeklyBackupsToKeep $retrievedBackupPolicy.WeeklyBackupsToKeep
50+
Assert-AreEqual $monthlyBackupsToKeep $retrievedBackupPolicy.MonthlyBackupsToKeep
51+
#returns 0 atm service side issue
52+
#Assert-AreEqual $yearlyBackupsToKeep $retrievedBackupPolicy.YearlyBackupsToKeep
53+
54+
# get and check a BackupPolicy by name and check again
55+
$getRetrievedBackupPolicy = Get-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1 -Name $backupPolicyName1
56+
Assert-AreEqual "$accName1/$backupPolicyName1" $getRetrievedBackupPolicy.Name
57+
Assert-True {$retrievedBackupPolicy.Enabled}
58+
Assert-AreEqual $dailyBackupsToKeep $getRetrievedBackupPolicy.DailyBackupsToKeep
59+
Assert-AreEqual $weeklyBackupsToKeep $getRetrievedBackupPolicy.WeeklyBackupsToKeep
60+
Assert-AreEqual $monthlyBackupsToKeep $getRetrievedBackupPolicy.MonthlyBackupsToKeep
61+
#returns 0 atm service side issue
62+
#Assert-AreEqual $yearlyBackupsToKeep $retrievedBackupPolicy.YearlyBackupsToKeep
63+
64+
$updatedDailyBackupsToKeep = 2
65+
$updatedBackupPolicy = Update-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -Location $backupLocation -AccountName $accName1 -Name $backupPolicyName1 -DailyBackupsToKeep $updatedDailyBackupsToKeep
66+
Assert-AreEqual $updatedDailyBackupsToKeep $updatedBackupPolicy.DailyBackupsToKeep
67+
68+
#create second BackupPolicy
69+
$secondBackupPolicy = New-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -Location $backupLocation -AccountName $accName1 -Name $backupPolicyName2 -Tag @{$newTagName = $newTagValue} -Enabled -DailyBackupsToKeep $dailyBackupsToKeep -WeeklyBackupsToKeep $weeklyBackupsToKeep -MonthlyBackupsToKeep $monthlyBackupsToKeep -YearlyBackupsToKeep $yearlyBackupsToKeep
70+
Assert-AreEqual "$accName1/$backupPolicyName2" $secondBackupPolicy.Name
71+
Assert-True {$retrievedBackupPolicy.Enabled}
72+
Assert-AreEqual $dailyBackupsToKeep $secondBackupPolicy.DailyBackupsToKeep
73+
Assert-AreEqual $weeklyBackupsToKeep $secondBackupPolicy.WeeklyBackupsToKeep
74+
Assert-AreEqual $monthlyBackupsToKeep $secondBackupPolicy.MonthlyBackupsToKeep
75+
#returns 0 atm service side issue
76+
#Assert-AreEqual $yearlyBackupsToKeep $retrievedBackupPolicy.YearlyBackupsToKeep
77+
78+
# get and check BackupPolicies by Account (list)
79+
$retrievedBackupPolicyList = Get-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1
80+
# check the names but the order does not appear to be guaranteed (perhaps because the names are randomly generated)
81+
Assert-AreEqual 2 $retrievedBackupPolicyList.Length
82+
Assert-True {"$accName1/$backupPolicyName1" -eq $retrievedBackupPolicyList[0].Name -or "$accName1/$backupPolicyName2" -eq $retrievedBackupPolicyList[0].Name}
83+
Assert-True {"$accName1/$backupPolicyName1" -eq $retrievedBackupPolicyList[1].Name -or "$accName1/$backupPolicyName2" -eq $retrievedBackupPolicyList[1].Name}
84+
85+
# get and check a BackupPolicy by name
86+
$getRetrievedBackupPolicy = Get-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1 -Name $backupPolicyName1
87+
Assert-AreEqual $accName1 $retrievedAcc.Name
88+
89+
# get and check the BackupPolicy again using the resource id just obtained
90+
$getRetrievedBackupPolicyById = Get-AzNetAppFilesBackupPolicy -ResourceId $retrievedBackupPolicy.Id
91+
Assert-AreEqual "$accName1/$backupPolicyName1" $getRetrievedBackupPolicyById.Name
92+
93+
# delete one BackupPolicy retrieved by id and one by name and check removed
94+
Remove-AzNetAppFilesBackupPolicy -ResourceId $getRetrievedBackupPolicyById.Id
95+
96+
# but test the WhatIf first, should not be removed
97+
Remove-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1 -Name $backupPolicyName2 -WhatIf
98+
$retrievedBackupPolicyList = Get-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1
99+
Assert-AreEqual 1 $retrievedBackupPolicyList.Length
100+
101+
#remove by name
102+
Remove-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1 -Name $backupPolicyName2
103+
$retrievedBackupPolicyList = Get-AzNetAppFilesBackupPolicy -ResourceGroupName $resourceGroup -AccountName $accName1
104+
Assert-AreEqual 0 $retrievedBackupPolicyList.Length
105+
}
106+
finally
107+
{
108+
# Cleanup
109+
Clean-ResourceGroup $resourceGroup
110+
}
111+
}
112+
113+
<#
114+
.SYNOPSIS
115+
Test BackupPolicy Pipeline operations (uses command aliases)
116+
#>
117+
function Test-BackupPolicyPipelines
118+
{
119+
$resourceGroup = Get-ResourceGroupName
120+
$accName1 = Get-ResourceName
121+
$backupPolicyName1 = Get-ResourceName
122+
$backupPolicyName2 = Get-ResourceName
123+
$accName2 = Get-ResourceName
124+
$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
125+
$dailyBackupsToKeep = 4
126+
$weeklyBackupsToKeep = 3
127+
$monthlyBackupsToKeep = 2
128+
$yearlyBackupsToKeep = 1
129+
$backupLocation = "eastus2euap"
130+
131+
try
132+
{
133+
# create the resource group
134+
New-AzResourceGroup -Name $resourceGroup -Location $backupLocation
135+
136+
New-AnfAccount -ResourceGroupName $resourceGroup -Location $backupLocation -Name $accName1
137+
$newTagName = "tag1"
138+
$newTagValue = "tagValue1"
139+
140+
$retrievedBackupPolicy = Get-AnfAccount -ResourceGroupName $resourceGroup -Name $accName1 | New-AzNetAppFilesBackupPolicy -Name $backupPolicyName1 -Tag @{$newTagName = $newTagValue} -Enabled -DailyBackupsToKeep $dailyBackupsToKeep -WeeklyBackupsToKeep $weeklyBackupsToKeep -MonthlyBackupsToKeep $monthlyBackupsToKeep -YearlyBackupsToKeep $yearlyBackupsToKeep
141+
142+
# get the policy by piping in from account
143+
$getRetrievedBackupPolicy = Get-AnfAccount -ResourceGroupName $resourceGroup -Name $accName1 | Get-AzNetAppFilesBackupPolicy -Name $backupPolicyName1
144+
}
145+
finally
146+
{
147+
# Cleanup
148+
Clean-ResourceGroup $resourceGroup
149+
}
150+
}

0 commit comments

Comments
 (0)