Skip to content

Commit 3596fe2

Browse files
Added hostnames field for Application Gateway Listeners (#22871)
* Added hostnames field for Application Gateway Listeners * added help files and change log.md * Removed Unwanted network .csproj file chnages * Removed unwanted extra spaces from Network.csproj --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent e982f5b commit 3596fe2

File tree

7 files changed

+69
-8
lines changed

7 files changed

+69
-8
lines changed

src/Network/Network/ApplicationGateway/Listener/AzureApplicationGatewayListenerBase.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public class AzureApplicationGatewayListenerBase : NetworkBaseCmdlet
8181
[ValidateNotNullOrEmpty]
8282
public string Protocol { get; set; }
8383

84+
[Parameter(
85+
HelpMessage = "Host names")]
86+
[ValidateNotNullOrEmpty]
87+
public string[] HostNames { get; set; }
88+
8489
public override void ExecuteCmdlet()
8590
{
8691
base.ExecuteCmdlet();
@@ -137,7 +142,12 @@ public PSApplicationGatewayListener NewObject()
137142
{
138143
listener.SslProfile = new PSResourceId();
139144
listener.SslProfile.Id = this.SslProfileId;
140-
}
145+
}
146+
147+
if (this.HostNames != null)
148+
{
149+
listener.HostNames = this.HostNames?.ToList();
150+
}
141151

142152
listener.Id = ApplicationGatewayChildResourceHelper.GetResourceNotSetId(
143153
this.NetworkClient.NetworkManagementClient.SubscriptionId,

src/Network/Network/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
* Updated cmdlet `New-AzLoadBalancerBackendAddressPool` to support managed IP based backend
2525
* Added cmdlet `New-AzSaaSNetworkVirtualAppliance` for creating a NetworkVirtualAppliance of SaaS type.
2626
* Added control knobs to virtual network gateways and ExpressRoute gateways as well to cmdlets operating on those.
27+
* Updated cmdlets to add Hostnames property for Application gateway Listener Configuration
28+
- `Set-AzApplicationGatewayListener`
29+
- `Add-AzApplicationGatewayListener`
30+
- `New-AzApplicationGatewayListener`
2731
* Added cmdlet 'Remove-AzApplicationGatewayFirewallCustomRule' to support removing custom rule in Firewall Policy.
2832

2933
## Version 6.2.0

src/Network/Network/Models/PSApplicationGatewayListener.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class PSApplicationGatewayListener : PSChildResource
3131
public string Type { get; set; }
3232
public PSResourceId SslProfile { get; set; }
3333

34+
public List<string> HostNames { get; set; }
35+
3436
[JsonIgnore]
3537
public string FrontendIpConfigurationText
3638
{

src/Network/Network/Network.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747

4848
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
4949

50-
</Project>
50+
</Project>

src/Network/Network/help/Add-AzApplicationGatewayListener.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Adds an listener to an application gateway.
1717
Add-AzApplicationGatewayListener -ApplicationGateway <PSApplicationGateway> -Name <String>
1818
[-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
1919
[-FrontendPort <PSApplicationGatewayFrontendPort>] [-SslCertificate <PSApplicationGatewaySslCertificate>]
20-
[-SslProfile <PSApplicationGatewaySslProfile>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
20+
[-SslProfile <PSApplicationGatewaySslProfile>] [-HostNames <String[]>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
2121
[<CommonParameters>]
2222
```
2323

2424
### SetByResourceId
2525
```
2626
Add-AzApplicationGatewayListener -ApplicationGateway <PSApplicationGateway> -Name <String>
2727
[-FrontendIPConfigurationId <String>] [-FrontendPortId <String>] [-SslCertificateId <String>]
28-
[-SslProfileId <String>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
28+
[-SslProfileId <String>] [-HostNames <String[]>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>] [-HostNames <String[]>] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -133,6 +133,21 @@ Accept pipeline input: False
133133
Accept wildcard characters: False
134134
```
135135
136+
### -HostNames
137+
Host names
138+
139+
```yaml
140+
Type: System.String[]
141+
Parameter Sets: (All)
142+
Aliases:
143+
144+
Required: False
145+
Position: Named
146+
Default value: None
147+
Accept pipeline input: False
148+
Accept wildcard characters: False
149+
```
150+
136151
### -Name
137152
The name of the Listener
138153

src/Network/Network/help/New-AzApplicationGatewayListener.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ Creates an TCP\TLS listener for an application gateway.
1717
New-AzApplicationGatewayListener -Name <String>
1818
[-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
1919
[-FrontendPort <PSApplicationGatewayFrontendPort>] [-SslCertificate <PSApplicationGatewaySslCertificate>]
20-
[-SslProfile <PSApplicationGatewaySslProfile>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
20+
[-SslProfile <PSApplicationGatewaySslProfile>] [-HostNames <String[]>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
2121
[<CommonParameters>]
2222
```
2323

2424
### SetByResourceId
2525
```
2626
New-AzApplicationGatewayListener -Name <String> [-FrontendIPConfigurationId <String>]
27-
[-FrontendPortId <String>] [-SslCertificateId <String>] [-SslProfileId <String>] -Protocol <String>
27+
[-FrontendPortId <String>] [-SslCertificateId <String>] [-SslProfileId <String>] [-HostNames <String[]>] -Protocol <String>
2828
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2929
```
3030

@@ -125,6 +125,21 @@ Accept pipeline input: False
125125
Accept wildcard characters: False
126126
```
127127
128+
### -HostNames
129+
Host names
130+
131+
```yaml
132+
Type: System.String[]
133+
Parameter Sets: (All)
134+
Aliases:
135+
136+
Required: False
137+
Position: Named
138+
Default value: None
139+
Accept pipeline input: False
140+
Accept wildcard characters: False
141+
```
142+
128143
### -Name
129144
The name of the Listener
130145

src/Network/Network/help/Set-AzApplicationGatewayListener.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Modifies a TCP\TLS listener for an application gateway.
1717
Set-AzApplicationGatewayListener -ApplicationGateway <PSApplicationGateway> -Name <String>
1818
[-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
1919
[-FrontendPort <PSApplicationGatewayFrontendPort>] [-SslCertificate <PSApplicationGatewaySslCertificate>]
20-
[-SslProfile <PSApplicationGatewaySslProfile>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
20+
[-SslProfile <PSApplicationGatewaySslProfile>] [-HostNames <String[]>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>]
2121
[<CommonParameters>]
2222
```
2323

2424
### SetByResourceId
2525
```
2626
Set-AzApplicationGatewayListener -ApplicationGateway <PSApplicationGateway> -Name <String>
2727
[-FrontendIPConfigurationId <String>] [-FrontendPortId <String>] [-SslCertificateId <String>]
28-
[-SslProfileId <String>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
28+
[-SslProfileId <String>] [-HostNames <String[]>] -Protocol <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -143,6 +143,21 @@ Accept pipeline input: False
143143
Accept wildcard characters: False
144144
```
145145
146+
### -HostNames
147+
Host names
148+
149+
```yaml
150+
Type: System.String[]
151+
Parameter Sets: (All)
152+
Aliases:
153+
154+
Required: False
155+
Position: Named
156+
Default value: None
157+
Accept pipeline input: False
158+
Accept wildcard characters: False
159+
```
160+
146161
### -Name
147162
The name of the Listener
148163

0 commit comments

Comments
 (0)