Skip to content

Commit 2b77d4c

Browse files
authored
Add destination IP address as parameter for PLS (#26075)
* Add destination IP address as parameter for PLS * Make Loadbalancer non required
1 parent 19a6aad commit 2b77d4c

File tree

5 files changed

+58
-11
lines changed

5 files changed

+58
-11
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
* Added support for `DefaultOutboundAccess` property in `Set-AzVirtualNetworkSubnetConfig` command
3131
* Added support for `EnabledFilteringCriteria` property in `New-AzNetworkWatcherFlowLog` and `Set-AzNetworkWatcherFlowLog` commands
3232
* Added support of `UserAssignedIdentityId` Property in `New-AzNetworkWatcherFlowLog` and `Set-AzNetworkWatcherFlowLog` commands
33+
* Added support of `DestinationIPAddress` property in `New-AzPrivateLinkService` command
34+
- `LoadBalancerFrontendIpConfiguration` is not a mandatory parameter anymore.
35+
- The user can provide either `LoadBalancerFrontendIpConfiguration` or `DestinationIPAddress`.
3336

3437
## Version 7.8.0
3538
* Added new cmdlets to support Save & Commit (AzureFirewallPolicy draft)

src/Network/Network/Models/PSPrivateLinkService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public partial class PSPrivateLinkService : PSTopLevelResource
3939

4040
public PSExtendedLocation ExtendedLocation { get; set; }
4141

42+
public string DestinationIPAddress { get; set; }
43+
4244
[JsonIgnore]
4345
public string LoadBalancerFrontendIpConfigurationsText
4446
{

src/Network/Network/Network.format.ps1xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,6 +5664,10 @@
56645664
<Label>ExtendedLocation</Label>
56655665
<PropertyName>ExtendedLocationText</PropertyName>
56665666
</ListItem>
5667+
<ListItem>
5668+
<Label>DestinationIPAddress</Label>
5669+
<PropertyName>DestinationIPAddress</PropertyName>
5670+
</ListItem>
56675671
</ListItems>
56685672
</ListEntry>
56695673
</ListEntries>

src/Network/Network/PrivateLinkService/NewAzurePrivateLinkServiceCommand.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ public class NewAzurePrivateLinkService : PrivateLinkServiceBaseCmdlet
5353
[Parameter(
5454
Mandatory = true,
5555
ValueFromPipelineByPropertyName = true,
56-
HelpMessage = "The front end ip configuration")]
56+
HelpMessage = "The ip configuration")]
5757
[ValidateNotNullOrEmpty]
58-
public PSFrontendIPConfiguration[] LoadBalancerFrontendIpConfiguration { get; set; }
58+
public PSPrivateLinkServiceIpConfiguration[] IpConfiguration { get; set; }
5959

6060
[Parameter(
61-
Mandatory = true,
61+
Mandatory = false,
6262
ValueFromPipelineByPropertyName = true,
63-
HelpMessage = "The ip configuration")]
63+
HelpMessage = "The front end ip configuration")]
6464
[ValidateNotNullOrEmpty]
65-
public PSPrivateLinkServiceIpConfiguration[] IpConfiguration { get; set; }
65+
public PSFrontendIPConfiguration[] LoadBalancerFrontendIpConfiguration { get; set; }
6666

6767
[Parameter(
6868
Mandatory = false,
@@ -104,6 +104,12 @@ public class NewAzurePrivateLinkService : PrivateLinkServiceBaseCmdlet
104104
HelpMessage = "Run cmdlet in the background")]
105105
public SwitchParameter AsJob { get; set; }
106106

107+
[Parameter(
108+
Mandatory = false,
109+
ValueFromPipelineByPropertyName = true,
110+
HelpMessage = "The destination IP address")]
111+
public string DestinationIPAddress { get; set; }
112+
107113
private PSPrivateLinkService CreatePSPrivateLinkService()
108114
{
109115
var psPrivateLinkService = new PSPrivateLinkService
@@ -135,6 +141,8 @@ private PSPrivateLinkService CreatePSPrivateLinkService()
135141
psPrivateLinkService.ExtendedLocation = new PSExtendedLocation(this.EdgeZone);
136142
}
137143

144+
psPrivateLinkService.DestinationIPAddress = this.DestinationIPAddress;
145+
138146
var plsModel = NetworkResourceManagerProfile.Mapper.Map<MNM.PrivateLinkService>(psPrivateLinkService);
139147
plsModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);
140148

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

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Creates a private link service
1414

1515
```
1616
New-AzPrivateLinkService -Name <String> -ResourceGroupName <String> -Location <String>
17-
-LoadBalancerFrontendIpConfiguration <PSFrontendIPConfiguration[]>
18-
-IpConfiguration <PSPrivateLinkServiceIpConfiguration[]> [-Visibility <String[]>] [-AutoApproval <String[]>]
19-
[-EnableProxyProtocol] [-EdgeZone <String>] [-Tag <Hashtable>] [-Force] [-AsJob]
20-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
-IpConfiguration <PSPrivateLinkServiceIpConfiguration[]> [-Visibility <String[]>] [-AutoApproval <String[]>]
18+
[-DestinationIPAddress <String>] [-EnableProxyProtocol] [-EdgeZone <String>] [-Tag <Hashtable>] [-Force] [-AsJob]
19+
[-DefaultProfile <IAzureContextContainer>] [-LoadBalancerFrontendIpConfiguration <PSFrontendIPConfiguration[]>]
20+
[-WhatIf] [-Confirm] [<CommonParameters>]
2121
```
2222

2323
## DESCRIPTION
@@ -27,7 +27,7 @@ The **New-AzPrivateLinkService** cmdlet creates a private link service
2727

2828
### Example 1
2929

30-
The following example creates a private link service.
30+
The following example creates a private link service with a load balancer.
3131

3232
```powershell
3333
$vnet = Get-AzVirtualNetwork -ResourceName 'myvnet' -ResourceGroupName 'myresourcegroup'
@@ -40,6 +40,21 @@ $lb = New-AzLoadBalancer -Name 'MyLoadBalancer' -ResourceGroupName 'myresourcegr
4040
New-AzPrivateLinkService -Name 'mypls' -ResourceGroupName myresourcegroup -Location "West US" -LoadBalancerFrontendIpConfiguration $frontend -IpConfiguration $IPConfig
4141
```
4242

43+
### Example 2
44+
45+
The following example creates a private link service with destinationIPAddress.
46+
47+
```powershell
48+
$vnet = Get-AzVirtualNetwork -ResourceName 'myvnet' -ResourceGroupName 'myresourcegroup'
49+
# View the results of $vnet and change 'mysubnet' in the following line to the appropriate subnet name.
50+
$subnet = $vnet | Select-Object -ExpandProperty subnets | Where-Object Name -eq 'mysubnet'
51+
$IPConfig1 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config1' -Subnet $subnet -PrivateIpAddress '10.0.0.5' -Primary
52+
$IPConfig2 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config2' -Subnet $subnet -PrivateIpAddress '10.0.0.6'
53+
$IPConfig3 = New-AzPrivateLinkServiceIpConfig -Name 'IP-Config3' -Subnet $subnet -PrivateIpAddress '10.0.0.7'
54+
$IPConfigs = @($IPConfig1, $IPConfig2, $IPConfig3)
55+
New-AzPrivateLinkService -Name 'mypls' -ResourceGroupName myresourcegroup -Location "West US" -IpConfiguration $IPConfigs -DestinationIPAddress '192.168.0.5'
56+
```
57+
4358
## PARAMETERS
4459

4560
### -AsJob
@@ -87,6 +102,21 @@ Accept pipeline input: False
87102
Accept wildcard characters: False
88103
```
89104
105+
### -DestinationIPAddress
106+
The destination IP address of the private link service.
107+
108+
```yaml
109+
Type: System.String
110+
Parameter Sets: (All)
111+
Aliases:
112+
113+
Required: False
114+
Position: Named
115+
Default value: None
116+
Accept pipeline input: True (ByPropertyName)
117+
Accept wildcard characters: False
118+
```
119+
90120
### -EdgeZone
91121
The edge zone of the private link service
92122
@@ -155,7 +185,7 @@ Type: Microsoft.Azure.Commands.Network.Models.PSFrontendIPConfiguration[]
155185
Parameter Sets: (All)
156186
Aliases:
157187

158-
Required: True
188+
Required: False
159189
Position: Named
160190
Default value: None
161191
Accept pipeline input: True (ByPropertyName)

0 commit comments

Comments
 (0)