Edit

Share via


Add-AzureEndpoint

Adds an endpoint to a virtual machine.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

NoLB (Default)

Add-AzureEndpoint
    [-Name] <String>
    [-Protocol] <String>
    [-LocalPort] <Int32>
    -VM <IPersistentVM>
    [-PublicPort <Int32>]
    [-DirectServerReturn <Boolean>]
    [-ACL <NetworkAclObject>]
    [-InternalLoadBalancerName <String>]
    [-IdleTimeoutInMinutes <Int32>]
    [-LoadBalancerDistribution <String>]
    [-VirtualIPName <String>]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

LBNoProbe

Add-AzureEndpoint
    [-Name] <String>
    [-Protocol] <String>
    [-LocalPort] <Int32>
    -LBSetName <String>
    -VM <IPersistentVM>
    [-PublicPort <Int32>]
    [-DirectServerReturn <Boolean>]
    [-ACL <NetworkAclObject>]
    [-NoProbe]
    [-InternalLoadBalancerName <String>]
    [-IdleTimeoutInMinutes <Int32>]
    [-LoadBalancerDistribution <String>]
    [-VirtualIPName <String>]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

LBDefaultProbe

Add-AzureEndpoint
    [-Name] <String>
    [-Protocol] <String>
    [-LocalPort] <Int32>
    -LBSetName <String>
    -VM <IPersistentVM>
    [-PublicPort <Int32>]
    [-DirectServerReturn <Boolean>]
    [-ACL <NetworkAclObject>]
    [-DefaultProbe]
    [-InternalLoadBalancerName <String>]
    [-IdleTimeoutInMinutes <Int32>]
    [-LoadBalancerDistribution <String>]
    [-VirtualIPName <String>]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

LBCustomProbe

Add-AzureEndpoint
    [-Name] <String>
    [-Protocol] <String>
    [-LocalPort] <Int32>
    -LBSetName <String>
    -ProbePort <Int32>
    -ProbeProtocol <String>
    -VM <IPersistentVM>
    [-PublicPort <Int32>]
    [-DirectServerReturn <Boolean>]
    [-ACL <NetworkAclObject>]
    [-ProbePath <String>]
    [-ProbeIntervalInSeconds <Int32>]
    [-ProbeTimeoutInSeconds <Int32>]
    [-InternalLoadBalancerName <String>]
    [-IdleTimeoutInMinutes <Int32>]
    [-LoadBalancerDistribution <String>]
    [-VirtualIPName <String>]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

Description

The Add-AzureEndpoint cmdlet adds an endpoint to an Azure virtual machine object.

Examples

Example 1: Add an endpoint

PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine01" | Add-AzureEndpoint -Name "HttpIn" -Protocol "tcp" -PublicPort 80 -LocalPort 8080 | Update-AzureVM

This command retrieves the configuration of a virtual machine named VirtualMachine01 by using the Get-AzureVM cmdlet. The command passes it to the current cmdlet by using the pipeline operator. This cmdlet adds an endpoint named HttpIn. The endpoint has a public port 80 and local port 8080. The command passes the virtual machine object to the Update-AzureVM cmdlet, which implements your changes.

Example 2: Add an endpoint that belongs to a load balanced group

PS C:\> Get-AzureVM -ServiceName "LoadBalancedService" -Name "VirtualMachine12" | Add-AzureEndpoint -Name "HttpIn" -Protocol "tcp" -PublicPort 80 -LocalPort 8080 -LBSetName "WebFarm" -ProbePort 80 -ProbeProtocol "http" -ProbePath '/' | Update-AzureVM

This command retrieves the configuration of a virtual machine named VirtualMachine07. The current cmdlet adds an endpoint named HttpIn. The endpoint has a public port 80 and local port 8080. The endpoint belongs to the shared load balanced group named WebFarm. An HTTP probe on port 80 with a path of '/' monitors the availability of the endpoint. The command implements your changes.

Example 3: Associate a virtual IP to an endpoint

PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine25" | Add-AzureEndpoint -Name "HttpIn" -Protocol "tcp" -LocalPort 8080 -PublicPort 80 -VirtualIPName "ContosoVip11" | Update-AzureVM

This command retrieves the configuration of a virtual machine named VirtualMachine25. The current cmdlet adds an endpoint named HttpIn. The endpoint has a public port 80 and local port 8080. This command associates a virtual IP to the endpoint. The command implements your changes.

Parameters

-ACL

Specifies an access control list (ACL) configuration object for the endpoint.

Parameter properties

Type:NetworkAclObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProbe

Indicates that this cmdlet uses the default probe setting.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBDefaultProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DirectServerReturn

Specifies whether this cmdlet enables direct server return. Specify $True to enable, or $False to disable.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IdleTimeoutInMinutes

Specifies the TCP idle time-out period, in minutes, for the endpoint.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend

Parameter properties

Type:ActionPreference
Default value:None
Supports wildcards:False
DontShow:False
Aliases:infa

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InformationVariable

Specifies an information variable.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:iv

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InternalLoadBalancerName

Specifies the name of the internal load balancer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LBSetName

Specifies the name of the load balancer set for the endpoint.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:LoadBalancedEndpointSetName

Parameter sets

LBNoProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
LBDefaultProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
LBCustomProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LoadBalancerDistribution

Specifies the load balancer distribution algorithm. Valid values are:

  • sourceIP. A two tuple affinity: Source IP, Destination IP
  • sourceIPProtocol. A three tuple affinity: Source IP, Destination IP, Protocol
  • none. A five tuple affinity: Source IP, Source Port, Destination IP, Destination Port, Protocol

The default value is none.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LocalPort

Specifies the local, private, port that this endpoint uses. Applications within the virtual machine listen on this port for service input requests for this endpoint.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies a name for the endpoint.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NoProbe

Indicates that this cmdlet uses the no probe setting.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBNoProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProbeIntervalInSeconds

Specifies the probe polling interval, in seconds, for the endpoint.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBCustomProbe
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProbePath

Specifies the relative path to the HTTP probe.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBCustomProbe
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProbePort

Specifies the port that the endpoint uses.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBCustomProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProbeProtocol

Specifies the port protocol. Valid values are:

  • tcp
  • http

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBCustomProbe
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProbeTimeoutInSeconds

Specifies the probe polling time-out period in seconds.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

LBCustomProbe
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Protocol

Specifies the protocol of the endpoint. Valid values are:

  • tcp
  • udp

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PublicPort

Specifies the public port that the endpoint uses. If you do not specify a value, Azure assigns an available port.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VirtualIPName

Specifies the name of a virtual IP address that Azure associates to the endpoint. Your service can have multiple virtual IPs. To create virtual IPs, use the Add-AzureVirtualIP cmdlet.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VM

Specifies the virtual machine to which the endpoint belongs.

Parameter properties

Type:IPersistentVM
Default value:None
Supports wildcards:False
DontShow:False
Aliases:InputObject

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Object