Skip to content

Commit

Permalink
Add edge zone parameter to public ip prefix cmdlet (#15240)
Browse files Browse the repository at this point in the history
* Add edge zone parameter to public ip prefix cmdlet

* Update documentation

* Add test session record

* Update change log

* Fix changelog

Co-authored-by: Will Ehrich <[email protected]>
  • Loading branch information
wdehrich and Will Ehrich authored Jun 11, 2021
1 parent 9901e21 commit 39e61ea
Show file tree
Hide file tree
Showing 8 changed files with 1,156 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,13 @@ public void TestPublicIpPrefixAllocatePublicIpAddress()
{
TestRunner.RunTestScript("Test-PublicIpPrefixAllocatePublicIpAddress");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.sdnnrp)]
public void TestPublicIpPrefixInEdgeZone()
{
TestRunner.RunTestScript("Test-PublicIpPrefixInEdgeZone");
}
}
}
39 changes: 39 additions & 0 deletions src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,43 @@ function Test-PublicIpPrefixAllocatePublicIpAddress
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test creating a public IP prefix in an edge zone. Subscriptions need to be explicitly whitelisted for access to edge zones.
#>
function Test-PublicIpPrefixInEdgeZone
{
# Setup
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$pipname = $rname+"pip"
$domainNameLabel = Get-ResourceName
$rglocation = "westus"
$resourceTypeParent = "Microsoft.Network/publicIpPrefixes"
$location = "westus"
$edgeZone = "microsoftlosangeles1"

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

# Create publicIpPrefix
New-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname -location $location -Sku Standard -PrefixLength 30 -EdgeZone $edgeZone
$publicIpPrefix = Get-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname

Assert-AreEqual $publicIpPrefix.ExtendedLocation.Name $edgeZone
Assert-AreEqual $publicIpPrefix.ExtendedLocation.Type "EdgeZone"
}
catch [Microsoft.Azure.Commands.Network.Common.NetworkCloudException]
{
Assert-NotNull { $_.Exception.Message -match 'Resource type .* does not support edge zone .* in location .* The supported edge zones are .*' }
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
Loading

0 comments on commit 39e61ea

Please sign in to comment.