Skip to content

Commit 39e61ea

Browse files
wdehrichWill Ehrich
andauthored
Add edge zone parameter to public ip prefix cmdlet (#15240)
* 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]>
1 parent 9901e21 commit 39e61ea

File tree

8 files changed

+1156
-2
lines changed

8 files changed

+1156
-2
lines changed

src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,13 @@ public void TestPublicIpPrefixAllocatePublicIpAddress()
4949
{
5050
TestRunner.RunTestScript("Test-PublicIpPrefixAllocatePublicIpAddress");
5151
}
52+
53+
[Fact]
54+
[Trait(Category.AcceptanceType, Category.CheckIn)]
55+
[Trait(Category.Owner, NrpTeamAlias.sdnnrp)]
56+
public void TestPublicIpPrefixInEdgeZone()
57+
{
58+
TestRunner.RunTestScript("Test-PublicIpPrefixInEdgeZone");
59+
}
5260
}
5361
}

src/Network/Network.Test/ScenarioTests/PublicIpPrefixTests.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,43 @@ function Test-PublicIpPrefixAllocatePublicIpAddress
248248
# Cleanup
249249
Clean-ResourceGroup $rgname
250250
}
251+
}
252+
253+
<#
254+
.SYNOPSIS
255+
Test creating a public IP prefix in an edge zone. Subscriptions need to be explicitly whitelisted for access to edge zones.
256+
#>
257+
function Test-PublicIpPrefixInEdgeZone
258+
{
259+
# Setup
260+
$rgname = Get-ResourceGroupName
261+
$rname = Get-ResourceName
262+
$pipname = $rname+"pip"
263+
$domainNameLabel = Get-ResourceName
264+
$rglocation = "westus"
265+
$resourceTypeParent = "Microsoft.Network/publicIpPrefixes"
266+
$location = "westus"
267+
$edgeZone = "microsoftlosangeles1"
268+
269+
try
270+
{
271+
# Create the resource group
272+
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
273+
274+
# Create publicIpPrefix
275+
New-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname -location $location -Sku Standard -PrefixLength 30 -EdgeZone $edgeZone
276+
$publicIpPrefix = Get-AzPublicIpPrefix -ResourceGroupName $rgname -name $rname
277+
278+
Assert-AreEqual $publicIpPrefix.ExtendedLocation.Name $edgeZone
279+
Assert-AreEqual $publicIpPrefix.ExtendedLocation.Type "EdgeZone"
280+
}
281+
catch [Microsoft.Azure.Commands.Network.Common.NetworkCloudException]
282+
{
283+
Assert-NotNull { $_.Exception.Message -match 'Resource type .* does not support edge zone .* in location .* The supported edge zones are .*' }
284+
}
285+
finally
286+
{
287+
# Cleanup
288+
Clean-ResourceGroup $rgname
289+
}
251290
}

0 commit comments

Comments
 (0)