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

Enable viewing of Public IP address extended location #15230

Merged
merged 6 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
38 changes: 21 additions & 17 deletions src/Network/Network.Test/ScenarioTests/PublicIpAddressTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -819,32 +819,36 @@ function Test-PublicIpAddressCRUD-IdleTimeout

<#
.SYNOPSIS
Tests creating new simple publicIpAddress.
Test for creating a new simple publicIpAddress in an edge zone. Subscriptions need to be explicitly whitelisted for access to edge zones.
#>
function Test-PublicIpAddressInEdgeZone
{
# Setup
$ResourceName = Get-ResourceName
$resourceName = Get-ResourceName
$domainNameLabel = Get-ResourceName
$ResourceGroupName = Get-ResourceGroupName;
$LocationName = "westus";
$EdgeZone = "microsoftlosangeles1";
$VMName = "MyVM";

try
{
# Create the resource group
New-AzResourceGroup -Name $ResourceGroupName -Location $LocationName

# Create publicIpAddres
New-AzPublicIpAddress -ResourceGroupName $ResourceGroupName -Name $ResourceName -Location $LocationName -EdgeZone $EdgeZone -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel
$resourceGroupName = Get-ResourceGroupName
$locationName = 'westus'
$edgeZone = 'microsoftlosangeles1'

$publicIP = Get-AzPublicIpAddress -Name $ResourceName -ResourceGroupName $ResourceGroupName
Assert-AreEqual $publicIP.ExtendedLocation.Name $EdgeZone
try
{
# Create the resource group
New-AzResourceGroup -Name $resourceGroupName -Location $locationName

# Create publicIpAddres
New-AzPublicIpAddress -ResourceGroupName $resourceGroupName -Name $resourceName -Location $locationName -EdgeZone $edgeZone -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel

$publicIP = Get-AzPublicIpAddress -Name $resourceName -ResourceGroupName $resourceGroupName
Assert-AreEqual $publicIP.ExtendedLocation.Name $edgeZone
Assert-AreEqual $publicIP.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 $ResourceGroupName
Clean-ResourceGroup $resourceGroupName
}
}
Loading