Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edge zone parameter to public ip prefix cmdlet #15240

Merged
merged 5 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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