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

Fixes #11298 - Example works with multiple subnets #11599

Merged
merged 2 commits into from
Apr 16, 2020
Merged
Changes from all 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
57 changes: 40 additions & 17 deletions src/Network/Network/help/New-AzPrivateEndpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,37 @@ Creates a private endpoint.

## SYNTAX

### All

```
New-AzPrivateEndpoint -Name <String> -ResourceGroupName <String> -Location <String> -Subnet <PSSubnet>
-PrivateLinkServiceConnection <PSPrivateLinkServiceConnection[]> [-ByManualRequest] [-Tag <Hashtable>]
[-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION

The **New-AzPrivateEndpoint** cmdlet creates a private endpoint.

## EXAMPLES

### 1: Create a private endpoint
```
$virtualNetwork = Get-AzVirtualNetwork -ResourceName MyVirtualNetwork -ResourceGroupName TestResourceGroup
$plsConnection= New-AzPrivateLinkServiceConnection -Name MyPLSConnections -PrivateLinkServiceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/providers/Microsoft.Network/privateLinkServices/privateLinkService" -RequestMessage "Please Approve my request"
New-AzPrivateEndpoint -Name MyPrivateEndpoint -ResourceGroup TestResourceGroup -Location centralus -PrivateLinkServiceConnection $plsConnection -Subnet $virtualNetwork.Subnets[0]
```
### Example 1: Create a private endpoint

The following example creates a private endpoint with a specific private link service ID in the
specified subnet in a virtual network.

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

## PARAMETERS

### -AsJob
Run cmdlet in the background

Run cmdlet as a job in the background.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -50,7 +57,8 @@ Accept wildcard characters: False
```

### -ByManualRequest
Using manual request.

Use manual request to establish the connection.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -65,6 +73,7 @@ Accept wildcard characters: False
```

### -DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Expand All @@ -80,7 +89,8 @@ Accept wildcard characters: False
```

### -Force
Do not ask for confirmation if you want to overwrite a resource

Do not ask for confirmation to overwrite a resource.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -95,7 +105,9 @@ Accept wildcard characters: False
```

### -Location
location.

Specifies a location for the private endpoint. Use [Get-AzLocation](/powershell/module/az.resources/get-azlocation)
to determine valid values for this parameter.

```yaml
Type: System.String
Expand All @@ -110,7 +122,8 @@ Accept wildcard characters: False
```

### -Name
The resource name.

Name of the private endpoint.

```yaml
Type: System.String
Expand All @@ -125,7 +138,8 @@ Accept wildcard characters: False
```

### -PrivateLinkServiceConnection
The private link service connection.

The resource ID to connect the private endpoint.

```yaml
Type: Microsoft.Azure.Commands.Network.Models.PSPrivateLinkServiceConnection[]
Expand All @@ -140,7 +154,8 @@ Accept wildcard characters: False
```

### -ResourceGroupName
The resource group name.

Specifies the name of the resource group.

```yaml
Type: System.String
Expand All @@ -155,7 +170,8 @@ Accept wildcard characters: False
```

### -Subnet
The subnet of the private endpoint

The subnet of the private endpoint.

```yaml
Type: Microsoft.Azure.Commands.Network.Models.PSSubnet
Expand All @@ -170,8 +186,9 @@ Accept wildcard characters: False
```

### -Tag

Key-value pairs in the form of a hash table. For example:
@{key0="value0";key1=$null;key2="value2"}
@{key0='value0';key1=$null;key2='value2'}

```yaml
Type: System.Collections.Hashtable
Expand All @@ -186,6 +203,7 @@ Accept wildcard characters: False
```

### -Confirm

Prompts you for confirmation before running the cmdlet.

```yaml
Expand All @@ -201,6 +219,7 @@ Accept wildcard characters: False
```

### -WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

Expand All @@ -217,7 +236,11 @@ Accept wildcard characters: False
```

### CommonParameters
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).

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).

## INPUTS

Expand Down