Skip to content

Commit d80ebe5

Browse files
authored
Merge pull request #10386 from number213/merge-network
Merge Network release branch into master
2 parents 4a96e0c + 235b24f commit d80ebe5

File tree

390 files changed

+305421
-233071
lines changed

Some content is hidden

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

390 files changed

+305421
-233071
lines changed

src/CognitiveServices/CognitiveServices.Test/CognitiveServices.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="6.0.0-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1616
</ItemGroup>
1717

1818
</Project>

src/Compute/Compute.Test/Compute.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="30.0.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="2.4.2" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/DataLakeStore/DataLakeStore.Test/DataLakeStore.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.DataLake.Store" Version="2.4.2-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/Dns/Dns.Test/Dns.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.Dns" Version="3.0.1" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1616
</ItemGroup>
1717

1818
</Project>

src/Dns/Dns.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests/TestPrivateZoneCrud.json

Lines changed: 395 additions & 338 deletions
Large diffs are not rendered by default.

src/Dns/Dns.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests/TestPrivateZoneCrudByVirtualNetworkIds.json

Lines changed: 392 additions & 335 deletions
Large diffs are not rendered by default.

src/Dns/Dns.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests/TestPrivateZoneCrudByVirtualNetworkObjects.json

Lines changed: 315 additions & 372 deletions
Large diffs are not rendered by default.

src/Dns/Dns.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests/TestPrivateZoneCrudRegistrationVirtualNetwork.json

Lines changed: 312 additions & 255 deletions
Large diffs are not rendered by default.

src/Dns/Dns.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests/TestPrivateZoneCrudResolutionVirtualNetwork.json

Lines changed: 315 additions & 258 deletions
Large diffs are not rendered by default.

src/KeyVault/KeyVault.Test/KeyVault.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
1515
<PackageReference Include="Microsoft.Azure.KeyVault.WebKey" Version="3.0.1" />
1616
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="2.4.2" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.1.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1616
</ItemGroup>
1717

1818
</Project>

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function Test-VolumeCrud
8383
# create the list of protocol types
8484
$protocolTypes = New-Object string[] 2
8585
$protocolTypes[0] = "NFSv3"
86-
$protocolTypes[1] = "NFSv4"
86+
$protocolTypes[1] = "NFSv4.1"
8787

8888
try
8989
{
@@ -112,8 +112,8 @@ function Test-VolumeCrud
112112
Assert-NotNull $retrievedVolume.ExportPolicy
113113
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[0].AllowedClients '0.0.0.0/0'
114114
Assert-AreEqual $retrievedVolume.ExportPolicy.Rules[1].AllowedClients '1.2.3.0/24'
115-
Assert-AreEqual $retrievedVolume.ProtocolTypes[0] 'NFSv3'
116-
Assert-AreEqual $retrievedVolume.ProtocolTypes[1] 'NFSv4.1'
115+
Assert-AreEqual $retrievedVolume.ProtocolTypes[0] $protocolTypes[0]
116+
Assert-AreEqual $retrievedVolume.ProtocolTypes[1] $protocolTypes[1]
117117
Assert-NotNull $retrievedVolume.MountTargets
118118

119119
# create second volume and check using the confirm flag
@@ -298,4 +298,4 @@ function Test-VolumePipelines
298298
# Cleanup
299299
Clean-ResourceGroup $resourceGroup
300300
}
301-
}
301+
}

src/NetAppFiles/NetAppFiles.Test/SessionRecords/Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest.SnapshotTests/TestSnapshotCrud.json

Lines changed: 816 additions & 702 deletions
Large diffs are not rendered by default.

src/NetAppFiles/NetAppFiles.Test/SessionRecords/Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest.SnapshotTests/TestSnapshotPipelines.json

Lines changed: 1070 additions & 582 deletions
Large diffs are not rendered by default.

src/NetAppFiles/NetAppFiles.Test/SessionRecords/Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest.VolumeTests/TestVolumeCrud.json

Lines changed: 1390 additions & 802 deletions
Large diffs are not rendered by default.

src/NetAppFiles/NetAppFiles.Test/SessionRecords/Microsoft.Azure.Commands.NetAppFiles.Test.ScenarioTests.ScenarioTest.VolumeTests/TestVolumePipelines.json

Lines changed: 794 additions & 500 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/Network.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.16.0-preview" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.17.0-preview" />
1818
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
1919
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="30.0.0" />
2020
<PackageReference Include="Microsoft.Azure.Management.ContainerInstance" Version="2.0.0" />

src/Network/Network.Test/NrpTeamAlias.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ class NrpTeamAlias
3434
// Split into subsets due to tests' long running time
3535
// Cortex and LocalNetworkGateway tests
3636
public const string brooklynft = "brooklynft";
37-
// VirtualNetworkGatewayConnection tests
37+
// First part of VirtualNetworkGatewayConnection tests
3838
public const string brooklynft_subset1 = "brooklynft_subset1";
3939
// First half of VirtualNetworkGateway tests
4040
public const string brooklynft_subset2 = "brooklynft_subset2";
4141
// Second half of VirtualNetworkGateway tests
4242
public const string brooklynft_subset3 = "brooklynft_subset3";
43+
// Second part of VirtualNetworkGatewayConnection tests
44+
public const string brooklynft_subset4 = "brooklynft_subset4";
4345

4446
// Azure Network Analytics Dev Team
4547
public const string netanalyticsdev = "netanalyticsdev";
@@ -49,5 +51,8 @@ class NrpTeamAlias
4951

5052
//Azure NRP Firewall dev team
5153
public const string azurefirewall = "azurefirewall";
54+
55+
// Azure NRP bastion dev team
56+
public const string bastion = "bastion";
5257
}
5358
}
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,37 @@
1-
// <auto-generated>
2-
// Copyright (c) Microsoft and contributors. All rights reserved.
3-
//
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
66
// You may obtain a copy of the License at
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
98
// Unless required by applicable law or agreed to in writing, software
109
// distributed under the License is distributed on an "AS IS" BASIS,
1110
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
//
1311
// See the License for the specific language governing permissions and
1412
// limitations under the License.
15-
//
16-
//
17-
// Warning: This code was generated by a tool.
18-
//
19-
// Changes to this file may cause incorrect behavior and will be lost if the
20-
// code is regenerated.
21-
//
22-
// For documentation on code generator please visit
23-
// https://aka.ms/nrp-code-generation
24-
// Please contact [email protected] if you need to make changes to this file.
25-
// </auto-generated>
13+
// ----------------------------------------------------------------------------------
2614

2715
using Microsoft.Azure.Commands.Network.Test.ScenarioTests;
2816
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2917
using Xunit;
18+
using Xunit.Abstractions;
3019

3120
namespace Commands.Network.Test.ScenarioTests
3221
{
33-
public class UsageTestsGenerated : NetworkTestRunner
22+
public class AzureFirewallPolicyTests : NetworkTestRunner
3423
{
35-
public UsageTestsGenerated(Xunit.Abstractions.ITestOutputHelper output)
24+
public AzureFirewallPolicyTests(ITestOutputHelper output)
3625
: base(output)
3726
{
3827
}
3928

4029
[Fact]
4130
[Trait(Category.AcceptanceType, Category.CheckIn)]
42-
[Trait(Category.Owner, NrpTeamAlias.wanrpdev)]
43-
public void TestUsageCRUDMinimalParameters()
31+
[Trait(Category.Owner, NrpTeamAlias.azurefirewall)]
32+
public void TestAzureFirewallPolicyCRUD()
4433
{
45-
TestRunner.RunTestScript("Test-UsageCRUDMinimalParameters");
34+
TestRunner.RunTestScript("Test-AzureFirewallPolicyCRUD");
4635
}
4736
}
4837
}
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
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+
Tests AzureFirewallPolicyCRUD.
18+
#>
19+
function Test-AzureFirewallPolicyCRUD {
20+
# Setup
21+
$rgname = Get-ResourceGroupName
22+
$azureFirewallPolicyName = Get-ResourceName
23+
$azureFirewallPolicyAsJobName = Get-ResourceName
24+
$resourceTypeParent = "Microsoft.Network/FirewallPolicies"
25+
$location = "westcentralus"
26+
27+
$ruleGroupName = Get-ResourceName
28+
29+
# AzureFirewallPolicyApplicationRuleCollection
30+
$appRcName = "appRc"
31+
$appRcPriority = 400
32+
$appRcActionType = "Allow"
33+
34+
$pipelineRcPriority = 154
35+
36+
# AzureFirewallPolicyApplicationRuleCollection 2
37+
$appRc2Name = "appRc2"
38+
$appRc2Priority = 300
39+
$appRc2ActionType = "Deny"
40+
41+
# AzureFirewallPolicyApplicationRule 1
42+
$appRule1Name = "appRule"
43+
$appRule1Desc = "desc1"
44+
$appRule1Fqdn1 = "*google.com"
45+
$appRule1Fqdn2 = "*microsoft.com"
46+
$appRule1Protocol1 = "http:80"
47+
$appRule1Port1 = 80
48+
$appRule1ProtocolType1 = "http"
49+
$appRule1Protocol2 = "https:443"
50+
$appRule1Port2 = 443
51+
$appRule1ProtocolType2 = "https"
52+
$appRule1SourceAddress1 = "192.168.0.0/16"
53+
54+
# AzureFirewallPolicyApplicationRule 2
55+
$appRule2Name = "appRule2"
56+
$appRule2Fqdn1 = "*bing.com"
57+
$appRule2Protocol1 = "http:8080"
58+
$appRule2Protocol2 = "https:443"
59+
$appRule2Port1 = 8080
60+
$appRule2ProtocolType1 = "http"
61+
$appRule2SourceAddress1 = "192.168.0.0/16"
62+
63+
# AzureFirewallPolicyNetworkRuleCollection
64+
$networkRcName = "networkRc"
65+
$networkRcPriority = 200
66+
$networkRcActionType = "Deny"
67+
68+
# AzureFirewallPolicyNetworkRule 1
69+
$networkRule1Name = "networkRule"
70+
$networkRule1Desc = "desc1"
71+
$networkRule1SourceAddress1 = "10.0.0.0"
72+
$networkRule1SourceAddress2 = "111.1.0.0/24"
73+
$networkRule1DestinationAddress1 = "*"
74+
$networkRule1Protocol1 = "UDP"
75+
$networkRule1Protocol2 = "TCP"
76+
$networkRule1Protocol3 = "ICMP"
77+
$networkRule1DestinationPort1 = "90"
78+
79+
# AzureFirewallPolicyNatRuleCollection
80+
$natRcName = "natRc"
81+
$natRcPriority = 200
82+
$natRcActionType = "Dnat"
83+
84+
# AzureFirewallPolicyNatRule 1
85+
$natRule1Name = "natRule"
86+
$natRule1Desc = "desc1"
87+
$natRule1SourceAddress1 = "10.0.0.0"
88+
$natRule1SourceAddress2 = "111.1.0.0/24"
89+
$natRule1DestinationAddress1 = "1.2.3.4"
90+
$natRule1Protocol1 = "UDP"
91+
$natRule1Protocol2 = "TCP"
92+
$natRule1DestinationPort1 = "90"
93+
$natRule1TranslatedAddress = "10.1.2.3"
94+
$natRule1TranslatedPort = "91"
95+
96+
try {
97+
# Create the resource group
98+
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval" }
99+
100+
# Create AzureFirewallPolicy (with no rules, ThreatIntel is in Alert mode by default)
101+
$azureFirewallPolicy = New-AzFirewallPolicy -Name $azureFirewallPolicyName -ResourceGroupName $rgname -Location $location
102+
103+
# Get AzureFirewallPolicy
104+
$getAzureFirewallPolicy = Get-AzFirewallPolicy -Name $azureFirewallPolicyName -ResourceGroupName $rgname
105+
106+
#verification
107+
Assert-AreEqual $rgName $getAzureFirewallPolicy.ResourceGroupName
108+
Assert-AreEqual $azureFirewallPolicyName $getAzureFirewallPolicy.Name
109+
Assert-NotNull $getAzureFirewallPolicy.Location
110+
Assert-AreEqual (Normalize-Location $location) $getAzureFirewallPolicy.Location
111+
Assert-AreEqual "Alert" $getAzureFirewallPolicy.ThreatIntelMode
112+
113+
114+
#Create Application Rules
115+
$appRule = New-AzFirewallPolicyApplicationRule -Name $appRule1Name -Description $appRule1Desc -Protocol $appRule1Protocol1, $appRule1Protocol2 -TargetFqdn $appRule1Fqdn1, $appRule1Fqdn2 -SourceAddress $appRule1SourceAddress1
116+
$appRule2 = New-AzFirewallPolicyApplicationRule -Name $appRule2Name -Description $appRule1Desc -Protocol $appRule2Protocol1, $appRule2Protocol2 -TargetFqdn $appRule2Fqdn1 -SourceAddress $appRule2SourceAddress1
117+
118+
# Create Network Rule Condition
119+
$networkRule = New-AzFirewallPolicyNetworkRule -Name $networkRule1Name -Description $networkRule1Desc -Protocol $networkRule1Protocol1, $networkRule1Protocol2 -SourceAddress $networkRule1SourceAddress1, $networkRule1SourceAddress2 -DestinationAddress $networkRule1DestinationAddress1 -DestinationPort $networkRule1DestinationPort1
120+
121+
# Create Filter Rule with 2 rules
122+
$appRc = New-AzFirewallPolicyFilterRuleCollection -Name $appRcName -Priority $appRcPriority -Rule $appRule, $appRule2 -ActionType $appRcActionType
123+
# Create a second Filter Rule Collection with 1 rule
124+
$appRc2 = New-AzFirewallPolicyFilterRuleCollection -Name $appRc2Name -Priority $appRc2Priority -Rule $networkRule -ActionType $appRc2ActionType
125+
126+
# Create a NAT rule
127+
$natRc = New-AzFirewallPolicyNatRuleCollection -Name $networkRcName -Priority $natRcPriority -Rule $networkRule -TranslatedAddress $natRule1TranslatedAddress -TranslatedPort $natRule1TranslatedPort -ActionType $natRcActionType
128+
129+
New-AzFirewallPolicyRuleCollectionGroup -Name $ruleGroupName -Priority 100 -RuleCollection $appRc, $appRc2, $natRc -FirewallPolicyObject $azureFirewallPolicy
130+
131+
132+
# # Update ThreatIntel mode
133+
$azureFirewallPolicy.ThreatIntelMode = "Deny"
134+
# Set AzureFirewallPolicy
135+
Set-AzFirewallPolicy -InputObject $azureFirewallPolicy
136+
# Get AzureFirewallPolicy
137+
$getAzureFirewallPolicy = Get-AzFirewallPolicy -Name $azureFirewallPolicyName -ResourceGroupName $rgName
138+
139+
# #verification
140+
Assert-AreEqual $rgName $getAzureFirewallPolicy.ResourceGroupName
141+
Assert-AreEqual $azureFirewallPolicyName $getAzureFirewallPolicy.Name
142+
Assert-NotNull $getAzureFirewallPolicy.Location
143+
Assert-AreEqual $location $getAzureFirewallPolicy.Location
144+
Assert-AreEqual "Deny" $getAzureFirewallPolicy.ThreatIntelMode
145+
146+
# # Check rule groups count
147+
Assert-AreEqual 1 @($getAzureFirewallPolicy.RuleCollectionGroups).Count
148+
149+
$getRg = Get-AzFirewallPolicyRuleCollectionGroup -Name $ruleGroupName -AzureFirewallPolicy $getAzureFirewallPolicy
150+
151+
Assert-AreEqual 3 @($getRg.properties.ruleCollection).Count
152+
153+
$filterRuleCollection1 = $getRg.Properties.GetRuleCollectionByName($appRcName)
154+
$natRuleCollection = $getRg.Properties.GetRuleCollectionByName($networkRcName)
155+
156+
# Verify filter Rule1
157+
Assert-AreEqual $appRcName $filterRuleCollection1.Name
158+
Assert-AreEqual $appRcPriority $filterRuleCollection1.Priority
159+
Assert-AreEqual $appRcActionType $filterRuleCollection1.Action.Type
160+
Assert-AreEqual 2 $filterRuleCollection1.Rules.Count
161+
162+
$appRule = $filterRuleCollection1.GetRuleByName($appRule1Name)
163+
# Verify application rule 1
164+
Assert-AreEqual $appRule1Name $appRule.Name
165+
166+
Assert-AreEqual 1 $appRule.SourceAddresses.Count
167+
Assert-AreEqual $appRule1SourceAddress1 $appRule.SourceAddresses[0]
168+
169+
Assert-AreEqual 2 $appRule.Protocols.Count
170+
Assert-AreEqual $appRule1ProtocolType1 $appRule.Protocols[0].ProtocolType
171+
Assert-AreEqual $appRule1ProtocolType2 $appRule.Protocols[1].ProtocolType
172+
Assert-AreEqual $appRule1Port1 $appRule.Protocols[0].Port
173+
Assert-AreEqual $appRule1Port2 $appRule.Protocols[1].Port
174+
175+
Assert-AreEqual 2 $appRule.TargetFqdns.Count
176+
Assert-AreEqual $appRule1Fqdn1 $appRule.TargetFqdns[0]
177+
Assert-AreEqual $appRule1Fqdn2 $appRule.TargetFqdns[1]
178+
179+
# Verify NAT rule collection and NAT rule)
180+
$natRule = $natRuleCollection.GetRuleByName($networkRcName)
181+
182+
Assert-AreEqual $networkRcName $natRuleCollection.Name
183+
Assert-AreEqual $natRcPriority $natRuleCollection.Priority
184+
185+
Assert-AreEqual $networkRule1Name $natRule.Name
186+
187+
Assert-AreEqual 2 $natRule.SourceAddresses.Count
188+
Assert-AreEqual $natRule1SourceAddress1 $natRule.SourceAddresses[0]
189+
Assert-AreEqual $natRule1SourceAddress2 $natRule.SourceAddresses[1]
190+
191+
Assert-AreEqual 1 $natRule.DestinationAddresses.Count
192+
193+
Assert-AreEqual 2 $natRule.Protocols.Count
194+
Assert-AreEqual $networkRule1Protocol1 $natRule.Protocols[0]
195+
Assert-AreEqual $networkRule1Protocol2 $natRule.Protocols[1]
196+
197+
Assert-AreEqual 1 $natRule.DestinationPorts.Count
198+
Assert-AreEqual $natRule1DestinationPort1 $natRule.DestinationPorts[0]
199+
200+
Assert-AreEqual $natRule1TranslatedAddress $natRuleCollection.TranslatedAddress
201+
Assert-AreEqual $natRule1TranslatedPort $natRuleCollection.TranslatedPort
202+
203+
204+
$testPipelineRg = Get-AzFirewallPolicyRuleCollectionGroup -Name $ruleGroupName -AzureFirewallPolicyName $getAzureFirewallPolicy.Name -ResourceGroupName $rgname
205+
$testPipelineRg|Set-AzFirewallPolicyRuleCollectionGroup -Priority $pipelineRcPriority
206+
$testPipelineRg = Get-AzFirewallPolicyRuleCollectionGroup -Name $ruleGroupName -AzureFirewallPolicyName $getAzureFirewallPolicy.Name -ResourceGroupName $rgname
207+
Assert-AreEqual $pipelineRcPriority $testPipelineRg.properties.Priority
208+
209+
$azureFirewallPolicyAsJob = New-AzFirewallPolicy -Name $azureFirewallPolicyAsJobName -ResourceGroupName $rgname -Location $location -AsJob
210+
$result = $azureFirewallPolicyAsJob | Wait-Job
211+
Assert-AreEqual "Completed" $result.State;
212+
}
213+
finally {
214+
# Cleanup
215+
Clean-ResourceGroup $rgname
216+
}
217+
}

0 commit comments

Comments
 (0)