Skip to content

Commit

Permalink
Deprecate Sku and add SkuName and SkuTier parameters for Firewall com…
Browse files Browse the repository at this point in the history
…mand (#13199)
  • Loading branch information
tejasshah7 authored Oct 13, 2020
1 parent 7671cc4 commit 83f16d8
Show file tree
Hide file tree
Showing 6 changed files with 992 additions and 3,206 deletions.
31 changes: 18 additions & 13 deletions src/Network/Network.Test/ScenarioTests/AzureFirewallTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,8 @@ function Test-AzureFirewallVirtualHubCRUD {
$policyLocation = "westcentralus"
$location = Get-ProviderLocation $resourceTypeParent
$azureFirewallPolicyName = Get-ResourceName
$sku = "AZFW_Hub"
$tier = "Standard"
$skuName = "AZFW_Hub"
$skuTier = "Standard"

try {
# Create the resource group
Expand All @@ -1243,7 +1243,7 @@ function Test-AzureFirewallVirtualHubCRUD {

$azureFirewallPolicyId = $getazureFirewallPolicy.Id

New-AzFirewall Name $azureFirewallName -ResourceGroupName $rgname -Location $location -Sku $sku -FirewallPolicyId $azureFirewallPolicyId
New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -SkuName $skuName -SkuTier $skuTier -FirewallPolicyId $azureFirewallPolicyId

# Get AzureFirewall
$getAzureFirewall = Get-AzFirewall -name $azureFirewallName -ResourceGroupName $rgname
Expand All @@ -1253,9 +1253,9 @@ function Test-AzureFirewallVirtualHubCRUD {
Assert-AreEqual $azureFirewallName $getAzureFirewall.Name
Assert-NotNull $getAzureFirewall.Location
Assert-AreEqual (Normalize-Location $location) $getAzureFirewall.Location
Assert-NotNull $sku $getAzureFirewall.Sku
Assert-AreEqual $sku $getAzureFirewall.Sku.Name
Assert-AreEqual $tier $getAzureFirewall.Sku.Tier
Assert-NotNull $getAzureFirewall.Sku
Assert-AreEqual $skuName $getAzureFirewall.Sku.Name
Assert-AreEqual $skuTier $getAzureFirewall.Sku.Tier
Assert-NotNull $getAzureFirewall.FirewallPolicy
Assert-AreEqual $azureFirewallPolicyId $getAzureFirewall.FirewallPolicy.Id
}
Expand Down Expand Up @@ -1404,6 +1404,9 @@ function Test-AzureFirewallWithDNSProxy {
$networkRule2Protocol3 = "ICMP"
$networkRule2DestinationPort1 = "80"

$skuName = "AZFW_VNet"
$skuTier = "Standard"

try {
# Create the resource group
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval" }
Expand Down Expand Up @@ -1437,14 +1440,16 @@ function Test-AzureFirewallWithDNSProxy {
$netRc.AddRule($networkRule2)

# Create AzureFirewall with DNSProxy enabled and DNS Servers provided
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -VirtualNetworkName $vnetName -PublicIpName $publicIpName -NetworkRuleCollection $netRc -EnableDnsProxy -DnsServer $dnsServers
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -VirtualNetworkName $vnetName -PublicIpName $publicIpName -NetworkRuleCollection $netRc -EnableDnsProxy -DnsServer $dnsServers -SkuName $skuName -SkuTier $skuTier

# Get AzureFirewall
$getAzureFirewall = Get-AzFirewall -name $azureFirewallName -ResourceGroupName $rgname

# Verification
Assert-AreEqual $rgName $getAzureFirewall.ResourceGroupName
Assert-AreEqual $azureFirewallName $getAzureFirewall.Name
Assert-AreEqual $skuName $getAzureFirewall.Sku.Name
Assert-AreEqual $skuTier $getAzureFirewall.Sku.Tier

# Check rule collections
Assert-AreEqual 1 @($getAzureFirewall.NetworkRuleCollections).Count
Expand Down Expand Up @@ -1485,16 +1490,16 @@ function Test-AzureFirewallVirtualHubMultiPublicIPCRUD {
$virtualHubName = Get-ResourceName
$virtualHubAddressPrefix = "10.0.0.0/16"
$firewallPIPCount = "2"
$sku = "AZFW_Hub"
$tier = "Standard"
$skuName = "AZFW_Hub"
$skuTier = "Standard"

try {
# Create the resource group
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval" }

$fwpips = New-AzFirewallHubPublicIpAddress -Count $firewallPIPCount
$hubIpAddresses = New-AzFirewallHubIpAddress -PublicIP $fwpips
$fw= New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -Sku AZFW_Hub -HubIPAddress $hubIpAddresses
$fw= New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -SkuName $skuName -SkuTier $skuTier -HubIPAddress $hubIpAddresses

# Get AzureFirewall
$getAzureFirewall = Get-AzFirewall -name $azureFirewallName -ResourceGroupName $rgname
Expand All @@ -1504,9 +1509,9 @@ function Test-AzureFirewallVirtualHubMultiPublicIPCRUD {
Assert-AreEqual $azureFirewallName $getAzureFirewall.Name
Assert-NotNull $getAzureFirewall.Location
Assert-AreEqual (Normalize-Location $location) $getAzureFirewall.Location
Assert-NotNull $sku $getAzureFirewall.Sku
Assert-AreEqual $sku $getAzureFirewall.Sku.Name
Assert-AreEqual $tier $getAzureFirewall.Sku.Tier
Assert-NotNull $getAzureFirewall.Sku
Assert-AreEqual $skuName $getAzureFirewall.Sku.Name
Assert-AreEqual $skuTier $getAzureFirewall.Sku.Tier
Assert-NotNull $getAzureFirewall.HubIPAddresses
Assert-NotNull $getAzureFirewall.HubIPAddresses.PublicIPs
Assert-AreEqual $firewallPIPCount $getAzureFirewall.HubIPAddresses.PublicIPs.Count
Expand Down
Loading

0 comments on commit 83f16d8

Please sign in to comment.