Skip to content

Commit 6af5c26

Browse files
authored
Fixes #11298 - Example works with multiple subnets (#11599)
* Fixes #11298 - Example works with multiple subnets * Standardized values in code examples
1 parent 9105b2c commit 6af5c26

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

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

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,37 @@ Creates a private endpoint.
1212

1313
## SYNTAX
1414

15+
### All
16+
1517
```
1618
New-AzPrivateEndpoint -Name <String> -ResourceGroupName <String> -Location <String> -Subnet <PSSubnet>
1719
-PrivateLinkServiceConnection <PSPrivateLinkServiceConnection[]> [-ByManualRequest] [-Tag <Hashtable>]
1820
[-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
1921
```
2022

2123
## DESCRIPTION
24+
2225
The **New-AzPrivateEndpoint** cmdlet creates a private endpoint.
2326

2427
## EXAMPLES
2528

26-
### 1: Create a private endpoint
27-
```
28-
$virtualNetwork = Get-AzVirtualNetwork -ResourceName MyVirtualNetwork -ResourceGroupName TestResourceGroup
29-
$plsConnection= New-AzPrivateLinkServiceConnection -Name MyPLSConnections -PrivateLinkServiceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/providers/Microsoft.Network/privateLinkServices/privateLinkService" -RequestMessage "Please Approve my request"
30-
New-AzPrivateEndpoint -Name MyPrivateEndpoint -ResourceGroup TestResourceGroup -Location centralus -PrivateLinkServiceConnection $plsConnection -Subnet $virtualNetwork.Subnets[0]
31-
```
29+
### Example 1: Create a private endpoint
30+
31+
The following example creates a private endpoint with a specific private link service ID in the
32+
specified subnet in a virtual network.
3233

33-
This example creates a private endpoint with specific private link service id in a specific subnet in a virtual network.
34+
```powershell
35+
$virtualNetwork = Get-AzVirtualNetwork -ResourceName 'myVirtualNetwork' -ResourceGroupName 'myResourceGroup'
36+
$subnet = $virtualNetwork | Select-Object -ExpandProperty subnets | Where-Object Name -eq 'mySubnet'
37+
$plsConnection= New-AzPrivateLinkServiceConnection -Name 'MyPLSConnections' -PrivateLinkServiceId '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateLinkServices/privateLinkService' -RequestMessage 'Please Approve my request'
38+
New-AzPrivateEndpoint -Name 'MyPrivateEndpoint' -ResourceGroup 'myResourceGroup' -Location 'centralus' -PrivateLinkServiceConnection $plsConnection -Subnet $subnet
39+
```
3440

3541
## PARAMETERS
3642

3743
### -AsJob
38-
Run cmdlet in the background
44+
45+
Run cmdlet as a job in the background.
3946

4047
```yaml
4148
Type: System.Management.Automation.SwitchParameter
@@ -50,7 +57,8 @@ Accept wildcard characters: False
5057
```
5158
5259
### -ByManualRequest
53-
Using manual request.
60+
61+
Use manual request to establish the connection.
5462
5563
```yaml
5664
Type: System.Management.Automation.SwitchParameter
@@ -65,6 +73,7 @@ Accept wildcard characters: False
6573
```
6674
6775
### -DefaultProfile
76+
6877
The credentials, account, tenant, and subscription used for communication with Azure.
6978
7079
```yaml
@@ -80,7 +89,8 @@ Accept wildcard characters: False
8089
```
8190
8291
### -Force
83-
Do not ask for confirmation if you want to overwrite a resource
92+
93+
Do not ask for confirmation to overwrite a resource.
8494
8595
```yaml
8696
Type: System.Management.Automation.SwitchParameter
@@ -95,7 +105,9 @@ Accept wildcard characters: False
95105
```
96106
97107
### -Location
98-
location.
108+
109+
Specifies a location for the private endpoint. Use [Get-AzLocation](/powershell/module/az.resources/get-azlocation)
110+
to determine valid values for this parameter.
99111
100112
```yaml
101113
Type: System.String
@@ -110,7 +122,8 @@ Accept wildcard characters: False
110122
```
111123
112124
### -Name
113-
The resource name.
125+
126+
Name of the private endpoint.
114127
115128
```yaml
116129
Type: System.String
@@ -125,7 +138,8 @@ Accept wildcard characters: False
125138
```
126139
127140
### -PrivateLinkServiceConnection
128-
The private link service connection.
141+
142+
The resource ID to connect the private endpoint.
129143
130144
```yaml
131145
Type: Microsoft.Azure.Commands.Network.Models.PSPrivateLinkServiceConnection[]
@@ -140,7 +154,8 @@ Accept wildcard characters: False
140154
```
141155
142156
### -ResourceGroupName
143-
The resource group name.
157+
158+
Specifies the name of the resource group.
144159
145160
```yaml
146161
Type: System.String
@@ -155,7 +170,8 @@ Accept wildcard characters: False
155170
```
156171
157172
### -Subnet
158-
The subnet of the private endpoint
173+
174+
The subnet of the private endpoint.
159175
160176
```yaml
161177
Type: Microsoft.Azure.Commands.Network.Models.PSSubnet
@@ -170,8 +186,9 @@ Accept wildcard characters: False
170186
```
171187
172188
### -Tag
189+
173190
Key-value pairs in the form of a hash table. For example:
174-
@{key0="value0";key1=$null;key2="value2"}
191+
@{key0='value0';key1=$null;key2='value2'}
175192
176193
```yaml
177194
Type: System.Collections.Hashtable
@@ -186,6 +203,7 @@ Accept wildcard characters: False
186203
```
187204
188205
### -Confirm
206+
189207
Prompts you for confirmation before running the cmdlet.
190208
191209
```yaml
@@ -201,6 +219,7 @@ Accept wildcard characters: False
201219
```
202220
203221
### -WhatIf
222+
204223
Shows what would happen if the cmdlet runs.
205224
The cmdlet is not run.
206225
@@ -217,7 +236,11 @@ Accept wildcard characters: False
217236
```
218237
219238
### CommonParameters
220-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
239+
240+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
241+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
242+
-WarningAction, and -WarningVariable. For more information, see
243+
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
221244
222245
## INPUTS
223246

0 commit comments

Comments
 (0)