Skip to content

Commit c7b3477

Browse files
authored
Merge pull request Azure#8705 from nirkum18/localjannetwork
New: Get Server Variables Cmdlets Powershell Changes
2 parents 7b76e71 + b03e0c5 commit c7b3477

File tree

9 files changed

+884
-1
lines changed

9 files changed

+884
-1
lines changed

src/Accounts/Accounts/AzureRmAlias/Mappings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,7 @@
12581258
"Set-AzApplicationGatewayAutoscaleConfiguration": "Set-AzureRmApplicationGatewayAutoscaleConfiguration",
12591259
"Set-AzApplicationGatewayAuthenticationCertificate": "Set-AzureRmApplicationGatewayAuthenticationCertificate",
12601260
"Get-AzApplicationGatewayAvailableWafRuleSets": "Get-AzureRmApplicationGatewayAvailableWafRuleSets",
1261+
"Get-AzApplicationGatewayAvailableServerVariableAndHeader": "Get-AzureRmApplicationGatewayAvailableServerVariableAndHeader",
12611262
"Get-AzApplicationGatewayAvailableSslOptions": "Get-AzureRmApplicationGatewayAvailableSslOptions",
12621263
"Add-AzApplicationGatewayBackendAddressPool": "Add-AzureRmApplicationGatewayBackendAddressPool",
12631264
"Get-AzApplicationGatewayBackendAddressPool": "Get-AzureRmApplicationGatewayBackendAddressPool",
@@ -1643,6 +1644,7 @@
16431644
"Get-AzExpressRoutePortLinkConfig": "Get-AzureRmExpressRoutePortLinkConfig",
16441645
"Get-AzExpressRoutePortsLocation": "Get-AzureRmExpressRoutePortsLocation",
16451646
"List-AzApplicationGatewayAvailableWafRuleSets": "List-AzureRmApplicationGatewayAvailableWafRuleSets",
1647+
"List-AzApplicationGatewayAvailableServerVariableAndHeader": "List-AzureRmApplicationGatewayAvailableServerVariableAndHeader",
16461648
"List-AzApplicationGatewayAvailableSslOptions": "List-AzureRmApplicationGatewayAvailableSslOptions",
16471649
"List-AzApplicationGatewaySslPredefinedPolicy": "List-AzureRmApplicationGatewaySslPredefinedPolicy",
16481650
"Get-AzExpressRouteGateway": "Get-AzureRmExpressRouteGateway",

src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,13 @@ public void TestApplicationGatewayCRUDRewriteRuleSet()
8989
{
9090
TestRunner.RunTestScript(string.Format("Test-ApplicationGatewayCRUDRewriteRuleSet -baseDir '{0}'", AppDomain.CurrentDomain.BaseDirectory));
9191
}
92+
93+
[Fact]
94+
[Trait(Category.AcceptanceType, Category.CheckIn)]
95+
[Trait(Category.Owner, NrpTeamAlias.nvadev)]
96+
public void TestAvailableServerVariableAndHeader()
97+
{
98+
TestRunner.RunTestScript("Test-AvailableServerVariableAndHeader");
99+
}
92100
}
93101
}

src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,3 +1571,40 @@ function Test-ApplicationGatewayCRUDSubItems2
15711571
Clean-ResourceGroup $rgname
15721572
}
15731573
}
1574+
1575+
function Test-AvailableServerVariableAndHeader
1576+
{
1577+
#Get server variables, request headers and response headers
1578+
$result = Get-AzApplicationGatewayAvailableServerVariableAndHeader
1579+
1580+
Assert-NotNull $result
1581+
Assert-True { $result.AvailableServerVariable.Count -gt 0 }
1582+
Assert-True { $result.AvailableRequestHeader.Count -gt 0 }
1583+
Assert-True { $result.AvailableResponseHeader.Count -gt 0 }
1584+
1585+
#Get server variables, request headers and response headers
1586+
$result = Get-AzApplicationGatewayAvailableServerVariableAndHeader -ServerVariable -RequestHeader -ResponseHeader
1587+
1588+
Assert-NotNull $result
1589+
Assert-True { $result.AvailableServerVariable.Count -gt 0 }
1590+
Assert-True { $result.AvailableRequestHeader.Count -gt 0 }
1591+
Assert-True { $result.AvailableResponseHeader.Count -gt 0 }
1592+
1593+
#Get server variables only
1594+
$result = Get-AzApplicationGatewayAvailableServerVariableAndHeader -ServerVariable
1595+
1596+
Assert-NotNull $result
1597+
Assert-True { $result.AvailableServerVariable.Count -gt 0 }
1598+
1599+
#Get request headers only
1600+
$result = Get-AzApplicationGatewayAvailableServerVariableAndHeader -RequestHeader
1601+
1602+
Assert-NotNull $result
1603+
Assert-True { $result.AvailableRequestHeader.Count -gt 0 }
1604+
1605+
#Get response headers only
1606+
$result = Get-AzApplicationGatewayAvailableServerVariableAndHeader -ResponseHeader
1607+
1608+
Assert-NotNull $result
1609+
Assert-True { $result.AvailableResponseHeader.Count -gt 0 }
1610+
}

0 commit comments

Comments
 (0)