Modifier

Partager via


Set-AzPrivateEndpoint

Updates a private endpoint.

Syntax

Set-AzPrivateEndpoint
   -PrivateEndpoint <PSPrivateEndpoint>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Set-AzPrivateEndpoint cmdlet updates a private endpoint.

Examples

Example 1: Creates a private endpoint and replace one of its subnets to another

$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"
$privateEndpoint = New-AzPrivateEndpoint -Name MyPrivateEndpoint -ResourceGroupName TestResourceGroup -Location centralus -PrivateLinkServiceConnection $plsConnection -Subnet $virtualNetwork.Subnets[0]

$privateEndpoint.Subnet = $virtualNetwork.Subnet[1]

$privateEndpoint | Set-AzPrivateEndpoint

This example creates a private endpoint with one subnet, then it replace to another subnet from the in-memory representation of the virtual network. The Set-PrivateEndpoint cmdlet is then used to write the modified private endpoint state on the service side.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrivateEndpoint

Specifies a private endpoint object representing the state to which the private endpoint should be set.

Type:PSPrivateEndpoint
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSPrivateEndpoint

Outputs

PSPrivateEndpoint